Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot get eventhandler() to work
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Cannot get eventhandler() to work
Miscellaneous
Thread ID:
00839068
Message ID:
00839068
Views:
50
Hi all,

What are the reasons this code would fail to work ?



LOCAL x as myclass
LOCAL oMsg as msg.msgServer2

x=NEWOBJECT("myclass")

oMsg = crea("msg.msgServer2")
? EVENTHANDLER( oMsg , x ) ** Code fails here, returns a .F.

oMsg.callMyOnlyFunction()




DO FORM main

READ events




** This class definition was drug & dropped from the object browser of the interface for Imsgserver in the "msg.msgServer" comm server.




DEFINE CLASS myclass AS session && OLEPUBLIC

IMPLEMENTS Imsgserver2 IN "msg.msgServer2"

PROCEDURE Imsgserver2_myOnlyFunction() AS VARIANT
* add user code here

WAIT WINDOW "Hello"

ENDPROC

PROCEDURE Imsgserver2_callMyOnlyFunction() AS VARIANT
* add user code here
ENDPROC

ENDDEFINE






Here is the code for the prg that defines the com server:


Define Class msgServer2 As Session OlePublic

Procedure myOnlyFunction

Endproc

Procedure callMyOnlyFunction()
This.myOnlyFunction()
Endproc

Enddefine




I then compile this as a com server & it shows up as expected in the object browser, instantiates as expected but the eventhandler() function returns false ! Must there be a special set of com PEMs to allow event binding ?

TIA
Greg Foote
Software At Work, Inc.
Next
Reply
Map
View

Click here to load this message in the networking platform