LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

COM Event Sinks

I am learning LabWindows/CVI and TestStand for some applications that have traditionally been done in VS C++ 6.0. A COM server is used in these applications and in the past, I have coded event sinks to handle events generated by the COM server. Is it possible to do this in the LabWindows environment and is there any documentation that might help with this?

Thanks,
John

0 Kudos
Message 1 of 3
(3,013 Views)

I don't know how TestStand does ActiveX. In CVI, when you create a "controller" for your ActiveX server using the "Create ActiveX Controller" item in the Tools menu, CVI generates functions to handle the events exposed by the server, along with other functions to create objects in the server and call them. These event functions are in a function class called "Event Callback Registration Functions" in the generated FP, and there is a registration function for each event. You can call these functions to register a callback function to be called when the server raises the associated event. Note that CVI only supports calling ActiveX servers that only use "automation-compatible" datatypes, i.e. IDispatch compatible types. So, if your server uses any custom types like structs, etc, then CVI will probably not be able to generate a "controller" for it.

0 Kudos
Message 2 of 3
(2,992 Views)
Thanks for the reply. It gives me a starting point to start looking at this. Everything is IDispatch compatible. In Visual C++, I'm simply using standard macros like BEGIN_SINK_MAP to create event maps that map the server generated events to handlers in my code. Standard stuff.

John

0 Kudos
Message 3 of 3
(2,990 Views)