LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

activex control

I am using an activex control- I used server conversion, which displays graphics.....the control originates from VB

 

Below is what I an trying to use:

1)tmp = CableEyeCtl_NewICableGfx (NULL, 1, LOCALE_NEUTRAL, 0, &CabGfx); ---->tmp = 0

2)HR = CA_GetInterfaceFromObjHandle (Cabcon, &CableEyeCtl_IID_ICableCx, 0, &sourceIUnknown, 0);  ---->Hr=0

 3)tmp = CableEyeCtl_SetICableGfxProperty (CabGfx, NULL, CableEyeCtl_ICableGfxCable, CAVT_UNKNOWN,sourceIUnknown); ----> tmp = 0

This does nothing....

I am not sure what to put into argument 5 of funtion 3 so I was trying 2).

 

Here is some more info:

HRESULT CVIFUNC CableEyeCtl_NewICableGfx (int panel, const char *label, int top,
                                          int left, int *controlID,
                                          int *UILError)
{
 HRESULT __result = S_OK;
 int ctrlId;
 GUID clsid = {0x5A42E23B, 0xCC98, 0x4FA5, 0x9F, 0xEF, 0x6, 0xE, 0x5A, 0xFF,
               0x6A, 0xFF};
 const char * licStr = "005847\\Cimbian/Siemens\\12-Apr-2013\\232P0-56H0C-RK036-PV338-02PP1";

 ctrlId = NewActiveXCtrl (panel, label, top, left, &clsid,
                          &CableEyeCtl_IID_ICableGfx, licStr, &__result);

 __ActiveXCtrlErrorHandler();

 return __result;
}

 

HRESULT CVIFUNC CableEyeCtl_SetICableGfxProperty (CAObjHandle objectHandle,
                                                  ERRORINFO *errorInfo,
                                                  unsigned int propertyID,
                                                  unsigned int propertyType, ...)
{
 HRESULT __result = S_OK;
 va_list args;

 va_start (args, propertyType);

 __result = CA_PropertySetVEx (objectHandle, errorInfo, 0, propertyID,
                               propertyType, args);

 va_end (args);

 return __result;
}

 

 

I am may be using the wrong handle and IID...but I am not sure if I am on the right path with function 3) argument 5.

 

Can anyone help?

 

 

0 Kudos
Message 1 of 4
(3,383 Views)

Hi Slten,

 

I have a few questions:

 

  1. What are you trying to achieve?
  2. What do you mean it does nothing?
  3. Where/what is argument 5?
  4. Where did you get the code you are trying to use?

 

James O

0 Kudos
Message 2 of 4
(3,360 Views)

1) I am trying to understand the functions and get them to work....They are to control a graphics control that work in Visual Basic

2) They will return Zero, but still not work

3) Argument 5 is the 5th placeholder in the function CAVT_UNKOWN

4) The code is originally an ActiveX cableEye control it is converted into an instrument driver by NI ActiveX Server wizard.

0 Kudos
Message 3 of 4
(3,348 Views)

The VB equivalent is 

CabGfx.Cable = CabCtl.DiffData

0 Kudos
Message 4 of 4
(3,293 Views)