Admin Production ni-theme
Current Publication

NewActiveXCtrlFromFile

LabWindows/CVI

NewActiveXCtrlFromFile

int NewActiveXCtrlFromFile (int panelHandle, char controlLabel[], int controlTop, int controlLeft, char filename[], const IID *interfaceID, HRESULT *activeXError);

Purpose

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

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

(Linux) This function is not supported.

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.
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.
filename char [] The full path of the file from which the object is initialized.
interfaceID const IID * The interface ID specifying the type of the interface pointer that is associated with the CAObjHandle for the ActiveX control.

Pass 0 to specify the default dispatch interface of the ActiveX control.
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.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 6.0 and later