Try changing your idle loop from:
while 1:
time.sleep(0.2)
to:
while 1:
pythoncom.PumpWaitingMessages()
time.sleep(0.2)
(possibly importing pythoncom first).
Mark
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of ÎÄÁú
Sent: Sunday, 14 January 2007 8:09 PM
To: [email protected]
Subject: [python-win32] MS Agent Event Handling via Python
Hi,
After searched a lot on web, not quit sure anybody met similar
problem before.
When I try to track the event fired by MS Agent by using
'DispatchWithEvents', I thought may be this is because IAgentNotifySink
did not registered by server.
I'm quite new to Python Com, it wrapped well, I wonder is there any
convient way to get IAgentNofiySink registered by Server?
Any clue and hint are appreciated!
-----------------------------------------------------------------
def TestMSAgent():
class AgentEvents:
def OnHide(self, CharacterID=defaultNamedNotOptArg,
Cause=defaultNamedNotOptArg):
print "Hiding"
def OnClick(self, CharacterID=defaultNamedNotOptArg,
Button=defaultNamedNotOptArg, Shift=defaultNamedNotOptArg,
x=defaultNamedNotOptArg, y=defaultNamedNotOptArg):
print "Clicked"
ag = DispatchWithEvents("Agent.Control", AgentEvents)
ag.Characters.Load("robby",r"C:\WINDOWS\msagent\chars\robby.acs")
robby = ag.Characters("robby")
robby = WithEvents(robby, AgentEvents)
robby.Show()
while 1:
time.sleep(0.2)
------------------------------------------------------------------
no any print after any clicking and hiding.
_______________________________________________
Python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32