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.