ObjectDCL Banner

AxControl_GetOleObject Method

Description

Some ActiveX control's methods or properties required the OleObject to be passed in as an argument (for example to set the ImageList property of a Microsoft ImageComboBox you need to pass in the OleObject). Calling this method on an ActiveX control will pass back the numeric value indicated by the OleObject. When finished using the OleObject, call AxObject_Release to release the OleObject from memory, failure to do so means the space occupied in memory by the OleObject will not be released for use by another application.

Parameters

MyControlReference
Reference to the control in the form of MyProject_MyForm_MyControl.
ProjectFile
String identifying the project as it was passed in LoadProject.
DialogName
String identifying the dialog by name.
ControlName
String identifying the control by name.

Return Values

Returns the following according to the situation:

  • OleObject handle to the object.
  • Nil if the control is not found.

AutoLISP Syntax

The recommended convention is passing the control identifier directly:

CopyCode imageCopy Code
(Odcl_AxControl_GetOleObject 
		MyControlReference [as Reference])

An alternative convention is to identify the control by providing the project file, the dialog name and the control name:

CopyCode imageCopy Code
(Odcl_AxControl_GetOleObject
		ProjectFile [as String]
		DialogName [as String]
		ControlName [as String])

Remarks

Does not apply to dialogs.

See the property of interest to know what string to pass.

Applies For

ActiveX.

Example

CopyCode imageCopy Code
; Get the ActiveX object
(Setq rObject (Odcl_AxControl_GetOleObject MyProject_MyForm_MyControl))

; Release the handle to the ActiveX
(Odcl_AxObject_Release rObject)

See Also

AxObject_Close, AxObject_Release