Returns an IDispatch pointer to the external COM object
Type: Property
Access: Read/Write
Data Type: Variant
Parameters:
None
Syntax
Property Variant pvComObject
Get pvComObject to VariantVariable |
Set pvComObject to VariantVariable/Value |
Description
pvComObject is a variant property which returns an IDispatch pointer to the external COM object.
Setting this property to the correct IDispatch* value connects a DataFlex wrapper object to its corresponding external COM object and increments the COM object's reference count.
Changing the pvComObject property or setting it to NULL (using the NullComObjectfunction) automatically releases any reference to the IDispatch pointed to by the old property value. Destroying the DataFlex wrapper object also automatically releases the reference to the COM object.
This property is automatically assigned and released when sending CreateComObject/ AttachActiveObject and ReleaseComObject.
Variant-type variables can be used to store IDispatch* values.
Note: | The DataFlex runtime protects against pointer arithmetic and comparison expressions for variant variables containing an IDispatch*. Doing so would raise a runtime error. The helper functions IsNullComObject and IsSameComObject can be used to perform any operations that you would normally require on variants containing IDispatch* values. |
Below is an example of creating a cComStdFont object and attaching it to an existing OLE font object using the pvComObject property:
// create an instance of OLE Font wrapper class...
Object oFont is a cComStdFont
End_Object
Procedure SetFontUnderline Variant vFont Boolean bMode
// bind our wrapper Object to the passed IDispatch*
Set pvComObject of oFont to vFont
// now we can change the title font...
Set ComUnderline of oFont To bMode
End_Procedure
See Also
cComAutomationObject