Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Binding Messenger COM-object
Message
 
 
To
28/06/2004 03:14:06
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00917852
Message ID:
00917892
Views:
8
You don't need VFPCOM utility in VFP8. You can use Object Browser to create events class and EVENTHANDLER() function to bind to COM events.


>I'm using following code to bind VFP8 to MSN Messenger :
>
>PUBLIC loVFPCOM,loOutlook,loLink
>
>loVFPCOM = CREATEOBJECT("VFPCOM.COMUTIL")
>loOutlook = CREATEOBJECT("Messenger.UIAutomation.1")
>loLink = CREATEOBJECT("MessengerApplicationEvents")
>
>loVFPCOM.BindEvents(loOutlook,loLink)
>
>DEFINE CLASS MessengerApplicationEvents as Custom
>
> PROCEDURE OnAppShutDown()
> MESSAGEBOX("Close MSN")
> ENDPROC
>
> PROCEDURE OnTextReceived(plMSession, pSourceUser, bstrMsgHeader, bstrMsgText, pfEnableDefault)
> MESSAGEBOX("User receives message")
> ENDPROC
>
>ENDDEFINE
>
>When running this code I get 'Unknown COM status code'. I got the method 'OnTextReceived' and 'OnAppShutDown' from the object browser of the 'Messenger 1.0 Type Library'...
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform