I think this has been talked about on a previous thread but its an old
thread here but I am hoping to get some feedback that will help me
understand the issue,

http://mail.python.org/pipermail/python-win32/2006-September/005044.html


I have an interface
MBTQUOTELib.
IMbtQuotesNotify
which has four methods to be implemented, each of which is an event on the
server side i.e. my broker.
One of the methods is "OnQuoteData(QUOTERECORD). The way I have seen it
being implemented (in the thread above) is
run makepy - i on the interface definition, i use PythonWin for this which
gives me a .py file.
13F76618-D199-4485-8C95-DC524958686Cx0x2x0.py

The implementation is
-------------------------------------------------------------------------------------------
from win32com import universal
universal.RegisterInterfaces('{13F76618-D199-4485-8C95-DC524958686C}',0,2,0,["IMbtQuotesNotify"])
class Q:
    _com_interfaces_ = ['IMbtQuotesNotify']
    _typelib_guid_ = '{13F76618-D199-4485-8C95-DC524958686C}'
    _typelib_version_ = 2, 0

    def OnQuoteData(self,pQuote):
        print "got onquote!"
        print type(pQuote)
        print "%s" % pQuote

import win32com.server.util
qnotify = win32com.server.util.wrap(Q(),useDispatcher=1)

import win32com.client as com
mbtCom = com.Dispatch("MBTrading.MbtComMgr")
mbtCom.DoLogin(9,"myusername","mypassword","")
quote = mbtCom.Quotes
quote.AdviseSymbol(qnotify,'AAPL',1)
---------------------------------------------------------------------
This produces no output. I am sure the login is succesful. Also, I have
implemented this in C# and i have some output there using the exact same
interface.
My question is, is there a way to debug this ? i.e if the callback function
is actually called or anything else. The 'useDispatcher' option does not
produce legible output. I think there might a problem with the
implementation.
Should i attach the interface generated file ?
Any assistance would be appreciated.
Thanks,
K.
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to