LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

GetObjHandlefromActiveXCtrl

I've written a DLL in CVI that loads and displays a panel that contains an active x control. I do a LoadPanelEx followed by a GetObjHandlefromActiveXCtrl to get the object handle of the control. If I call this DLL from teststand. If I configure the CVI adapter to run in an external instance of CVI, then everything runs fine and I can return an objecthandle. If I change the adapter to execute steps in process, then it doesn't return an object handle (0).
 
Is there something obvious that I'm doing wrong?
0 Kudos
Message 1 of 3
(3,316 Views)

Just a little more info.... GetObjHandlefromActiveXCtrl returns -45 which is "The control type passed was not a valid type". It's strange that it works when I call it one way from teststand but not the other.

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

Hi kwseitz3,

Also you may want to make sure you are running in a single threaded apartment (STA).  Here is a link that talks about it:

http://digital.ni.com/public.nsf/websearch/0868E14D531C88898625706900723C13?OpenDocument

And an example:

http://zone.ni.com/devzone/cda/epd/p/id/1987

Are you able to step through the code to see when the handle is being lost? 

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 3 of 3
(3,268 Views)