04-22-2009 12:12 PM
Using Labwindows version 7.1.1 and Global Majic aircraft library v.1.1.
Able to put AH into a panel. constant name PANEL_2_AIR.
According to Labwindows, when you store ActiveX controls in .uir files you
do not need to use the creation functions included in the control driver.
The control is created at the time that you load the panel from the file,
using LoadPanel. You identify the control in subsequent calls to users
interface library functions with the constant name that you assigned to the
control in the User Interface Editor.
but using GetObjHandleFromActiveXCtrl() returns an invalid handle. A
negative number.
Is this an incompatibility with CVI?
We tried another tack to create object.
To get trackID used
AIRLib_New_DAir() which returned 12.
Then used GetObjHandleFromActiveXCtrl() and returned a valid handle.
SetAHRoll()sets a roll to 20 deg.
GetAHRoll() reads a 20 deg roll.
But the display does not move 20 deg.
How can we get the instance of the New_Dair to display?
04-23-2009 12:18 PM
Hi,
You are correct that you can call LoadPanel to obtain a handle to the Panel. For example, if you have a Panel that has the constant name PANEL you can make the following call to load the panel into memory and obtain a handle to it.
int panelHandle = LoadPanel (0, "uirFileName.uir", PANEL);
Once you have obtained this handle, you can make a call to
CAObjHandle objHandle;
GetObjHandleFromActiveXCtrl (panelHandle, PANEL_ACTIVEXCONSTANTNAME, &objHandle);
This function accepts:
int Panel_Handle - a handle to the panel
int Control_ID - the Constant name of the Control
This function returns:
CAObjHandle *Object_Handle - a handle to the ActiveX object
Can you verify that you are passing the correct Constant values to the function and that you are declaring a variable of type CAObjHandle to be used for the returned value of the object handle.
-Adri K