Hello,
I have a custom control written in VB6 that I cannot get to work with
in LabWindows. The control has been stripped down to no dependencies
and has only a single public function that raises a message box and
returns a constant number.
In CVI, I can create the control on a .uir, make an .fp file for the
control using the ActiveX controller wizard, and call the function of
the ocx. The call does not show the message box, it does not return
the constant, and it does not return an error.
The control is called MeasCtrl in the following, my main looks like
this:
#include
#include "MeasCtrl.h"
#include "InstrumControl.h"
#include
#include
#include "test.h"
static int panelHandle;
static CAObj
Handle measHandle = 0;
static CAObjHandle intHandle = 0;
short result;
int main (int argc, char *argv[])
{
HRESULT status;
measHandle = 0;
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
if ((panelHandle = LoadPanel (0, "test.uir", PANEL)) < 0)
return -1;
result = 1;
GetObjHandleFromActiveXCtrl (panelHandle, PANEL_OMXMEASCTRL,
&measHandle);
status = MeasCtrl__OMXMeasCtrlTest (measHandle, NULL, &result );
DisplayPanel (panelHandle);
RunUserInterface ();
DiscardPanel (panelHandle);
return 0;
}
When the MeasCtrl_OMXMeasCtrlTest function is called, status = 0 ,
result = 1 (the function should return 3). measHandle is non zero. I
can trace the function call into the MeasCtrl.c file, and no errors
show up there either.
Any suggestions about what could be wrong with this? Is there
something I have to do to my control to make it work with CVI?