# NewActiveXCtrl

int NewActiveXCtrl (int panelHandle, char controlLabel[], int controlTop, int controlLeft, const GUID *classID, const IID *interfaceID, char license[], HRESULT *activeXError);

## Purpose

Creates a new ActiveX control and returns a control ID used to specify the control in subsequent function calls.

Linux This function is not supported.

This function also creates and caches a CAObjHandle for the ActiveX control object. Use GetObjHandleFromActiveXCtrl to get the CAObjHandle.

## 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.
controlLabel | char [] | The label of the new control. Pass "" or 0 for no label.
controlTop | int | The vertical coordinate at which the upper left corner of the control (not including labels) is placed. The coordinate must be an integer value from –32,768 to 32,767. The origin (0,0) is at the upper-left corner of the panel directly below the title bar before the panel is scrolled.
controlLeft | int | The horizontal coordinate at which the upper left corner of the control (not including labels) is placed. The coordinate must be an integer value from –32,768 to 32,767. The origin (0,0) is at the upper-left corner of the panel directly below the title bar before the panel is scrolled.
classID | const GUID * | The Class ID of the ActiveX control object.
interfaceID | const IID * | The interface ID specifying the type of the interface pointer that is associated with the CAObjHandle of the ActiveX control. Pass 0 to specify the default dispatch interface of the ActiveX control.
license | char [] | Run-time license string for the ActiveX control. Pass 0 if the ActiveX control does not support licensing.
Output
Name | Type | Description
activeXError | HRESULT | The HRESULT if this function causes an ActiveX error. In the event of an ActiveX error, this function returns a value of UIActiveXError.

## Return Value

Name | Type | Description
controlID | int | Returns the ID used to specify this control in subsequent function calls. Negative values indicate that an error occurred. Zero is not a valid ID.
Code | Error Message String
xx | Control ID (success)