# 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.

## Parameters

Input
Name | Type | Description
panelHandle | integer | Specifier for a particular panel that is currently in memory. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel.
controlID | integer | 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 NewCtrl or DuplicateCtrl.
Output
Name | Type | Description
objectHandle | CAObjHandle (passed by reference) | 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 | integer | Return value indicating whether the function was successful. A negative number indicates that an error occurred.
Code | Error Message String
xx | Success