LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

InstallCtrlCallback

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.

0 Kudos
Message 1 of 9
(4,637 Views)

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.

0 Kudos
Message 2 of 9
(4,630 Views)

@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:

  • apps\uirview\uirview.cws
  • dotnet\SimpleTaskMonitor\SimpleTaskMonitor.cws
  • userint\buildui.cws

You also can have a look at this site

0 Kudos
Message 3 of 9
(4,623 Views)

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.

0 Kudos
Message 4 of 9
(4,573 Views)

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.

--
Martin
Certified CVI Developer
0 Kudos
Message 5 of 9
(4,561 Views)

Does this mean i'm stuck?  Or, I just have to figure out how to write wrapper type functions myself?

0 Kudos
Message 6 of 9
(4,548 Views)

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?

--
Martin
Certified CVI Developer
0 Kudos
Message 7 of 9
(4,542 Views)

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. 

0 Kudos
Message 8 of 9
(4,535 Views)

Correction, it's a custom ActiveX server.

0 Kudos
Message 9 of 9
(4,534 Views)