Skip to content

CreateProxyControl - cCJAction

Create a proxy object that is bound to the passed COM control

Type: Function
Return Data Type: Handle

Parameters

Parameter Type Description
vControl Variant Pointer to the COM control object to be bound to a newly created proxy object

Syntax

Function CreateProxyControl Variant vControl Returns Handle

Call Example

Get CreateProxyControl vControl to HandleVariable

Description

CreateProxyControl creates a new DataFlex object and binds it to the passed COM control. The class of the newly created object will vary based on the ComType of the passed control. The proxy class used for this object will be determined by calling ClassForControlType function.

It is the programmer's responsibility to destroy this object when they no longer need it.

Sample

The following sample shows how a proxy object is created, used and destroyed.

// when used with combos, the control is passed 
Procedure OnPopupInit Variant vCommandBarControl Handle hoCommandBarControls
    Handle hoCombo
    Get CreateProxyControl vCommandBarControl to hoCombo
    Send FillComboList hoCombo
    Send Destroy of hoCombo
End_Procedure

Note

This function is used when you have pointer to the COM control you wish to bind to. If you do not have the pointer to the COM control, you can use CreateFirstProxyControl to find the COM object's pointer and create the proxy object. You can also use FindFirstControl and FindAllControls to find the COM pointers and then use CreateProxyControl to create the object.

This function will be used most often with the complex menu item controls such as combos and edits. See cCJCommandbarComboBox and cCJCommandbarEdit for more samples.

See Also

OnPopupInit

Return Value

Returns handle to newly created proxy object bound to the COM control. Returns zero if an error occurred.