06-19-2013 04:07 PM
Can anyone direct me to sample code that shows a good example of using the InstallCtrlCallback() function in CVI? I need to create my own callback for an activeX control and I am not sure how to do so. Thanks.
06-19-2013 06:26 PM
Does Anyone know if CVI will always created a "Event Callback Registration Function" class if you run the ActiveX control wizard. I have some callbacks functions from the control that it did not and I don't know how to handle those.
06-19-2013 10:58 PM
@rwmahar wrote:
Can anyone direct me to sample code that shows a good example of using the InstallCtrlCallback() function in CVI? I need to create my own callback for an activeX control and I am not sure how to do so. Thanks.
Why don't you start using the help that comes with CVI? The help on InstallCtrlCallback provides the following information:
Refer to the following examples that use the InstallCtrlCallback function:
You also can have a look at this site
06-25-2013 09:28 AM
This site you pointed me to seems pretty straight foreward. My problem is i'm trying to code the interface that will register the event callback functions. It seems to be a little more complicated than the typical UI event callbacks. If not, maybe I'm just making it more difficult. I am trying to find an example that is closer to what I need, but have not.
06-26-2013 07:14 AM
InstallCtrlCallback is for handling the events from built-in CVI controls, not ActiveX objects, so it won't help you.
The ActiveX Controller Wizard in CVI will normally create Event Registration Functions in the fp for all the events defined in the Events interface for the ActiveX server. It is worthwhile clicking on the 'Advanced Options...' button in the Controller Wizard to check the objects and functions that the CVI wizard has managed to understand.
I seem to recall that it is possible to define ActiveX server events in such a way that VB etc. can use them but the CVI wizard does not recognise them. You may have encountered one of these situations.
06-26-2013 09:16 AM
Does this mean i'm stuck? Or, I just have to figure out how to write wrapper type functions myself?
06-26-2013 10:40 AM
If the ActiveX control code is under your control you could get the IDL rewritten so that it works properly. Othrwise I suppose you could look into the CVI controller code to see if you can write some new event callback registration code.
What ActiveX is it?
06-26-2013 02:13 PM
The questions are surrounding a custom ActiveX control from a customer. Previous implementation was done (not by our organization) so using VB and C#. It seems to work nicely because you can create a new class and inherit from the interace and use COM functions to query the interface. In CVI the interface was created using a structure of function pointers (V table). One of the functions created (by the wizard) wants the CAObjHandle to the interface passed to it. I'm not sure how to do that with this configuration and I'm also not sure what to do about the call backs.
06-26-2013 02:14 PM
Correction, it's a custom ActiveX server.