NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get event from message?

Hi,All:
I write a run-time interface by CVI, I use TS_EngineRegisterUIMessageCallback to register my callback function, but when message passed to the callback function, as the type is struct IDispatch but not CAObjHandle, I don't know how to read event from message.
Can you help me to solve it? Thanks

Chang Zhang
0 Kudos
Message 1 of 2
(3,004 Views)
Hello Chang-

If your question is simply how to obtain an object handle from an object of type IDispatch, have you investigated the function "CA_CreateObjHandleFromIDispatch"? I would recommend you look over the testexec.prj that is installed along with the TestStand engine (the CVI Operator Interface) and inspect how we handle our callbacks, this may help you understand how to go about emulating the behavior in your own project. To see this particular function in use it may be most helpful to look in the file 'engine.c' and inside the function UIMessageDeferredCallback here you will see the IDispatch pointer being handled and decoded for use by the TS engine.

Regards,
Elaine R.
Applications Engineering
National Instruments
http://www.ni.com/ask
0 Kudos
Message 2 of 2
(3,004 Views)