Admin Production ni-theme
Current Publication

GetObjHandleFromActiveXCtrl

LabWindows/CVI

GetObjHandleFromActiveXCtrl

int GetObjHandleFromActiveXCtrl (int panelHandle, int controlID, CAObjHandle *objectHandle);

Purpose

Obtains the CAObjHandle that is created when the ActiveX control is created.

(Linux) This function is not supported.

The CAObjHandle is created with multithreading support and LOCALE_NEUTRAL. Refer to CA_SetSupportForMultithreading and CA_SetLocale to change these default settings.

Supported Controls

You can use GetObjHandleFromActiveXCtrl with ActiveX controls.

Parameters

Input
Name Type Description
panelHandle int Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel.
controlID int The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by functions such as NewCtrl and DuplicateCtrl.
Output
Name Type Description
objectHandle CAObjHandle The CAObjHandle associated with the specified ActiveX control.

Use this handle to call methods or get and set properties of this Automation object. If the control does not have any methods or properties, this handle is set to 0.

This handle is cached by the ActiveX control and will be discarded when the control is discarded. You do not need to discard the handle.

Note   If you call RecallPanelState after obtaining the CAObjHandle, that handle is no longer valid. You must obtain a new handle after each time you call RecallPanelState.

Return Value

Name Type Description
status int Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 6.0 and later

Examples

Refer to the following examples that use the GetObjHandleFromActiveXCtrl function:

  • userint\activex\3DGraph.cws

    Open example
  • userint\activex\3DGraphAxis.cws

    Open example
  • userint\activex\3DGraphColorMap.cws

    Open example
  • userint\activex\richTextbox.cws

    Open example
  • userint\activex\WebBrowser.cws

    Open example