about Comat event handler: how to register specified event ?
Posted: Thu Feb 19, 2009 11:13 am
I wan't process flash ocx event ,the code like bellow:
the flash ocx 's flashcall event prototype is:
It requires a string value as return , so i write event handler procedure is:
but when i run the app, the flash can't receive the return value:"<string>ok</string>"
it is a bug for COMate?
additional, Comate SetEventHandler function register all control's event to the handler, but how i register a specified event to ONE PB's procedure? like
for flashcall event :
perhapse,it is a GOOD function to PB coder
Comate is a great works!!
Code: Select all
FlashObject = COMate_CreateObject("ShockwaveFlash.ShockwaveFlash", GadgetID(winhd) )
Debug FlashObject
If FlashObject
FlashObject\SetEventHandler(@myEventCallback())
....
Code: Select all
Public Event FlashCall(ByVal request As String) As String
Code: Select all
Procedure.s myEventCallback(object.COMateObject, eventName.s, parameterCount)
If eventName = "OnReadyStateChange"
ElseIf eventName = "FlashCall"
Debug "FlashCall,param count:" + Str(parameterCount) + ":command:" +object\GetStringEventParam(1) + ",args :" + object\GetStringEventParam(2)
[b]ProcedureReturn "<string>ok</string>"[/b]
ElseIf eventName = "OnProgress"
ElseIf eventName = "FSCommand"
Debug "FSCommand ,param count:" + Str(parameterCount) + ",request :"+object\GetStringEventParam(1)
Else
Debug " woo,unknown event for flash ocx"
EndIf
it is a bug for COMate?
additional, Comate SetEventHandler function register all control's event to the handler, but how i register a specified event to ONE PB's procedure? like
Code: Select all
...
comateObj\SetEventHandler("event name",@eventHandler)?
Code: Select all
...
FlashObject\SetEventHandler("FlashCall",@flashCallHandler())
....
;;flashcall event handler
procedure.s flashCallHandler(....)
...
procedurereturn "return value"
endprocedure
....

Comate is a great works!!