ComProp()
ComProp() is a function added in VFP 7 that allows you to change certain properties of a COM object after it's been instantiated. The two properties that can be changed are UTF8, which determines whether UNICODE strings are converted to ANSI, and PUTREF, which determines how VFP assigns the COM object's properties: by reference or by value.
Usage |
nReturnValue = ComProp( oComObject, cProperty [, nValue ] ) |
Parameter |
Value |
Meaning |
oComObject |
Object |
The COM object reference. |
cProperty |
"UTF8" |
The property that determines whether UNICODE strings are converted to ANSI. By default, they are. |
"PUTREF" |
The property that determines whether the object's properties are assigned by PROPERTY_PUTREF or PROPERTY_PUT. PROPERTY_PUT is the default. |
|
nValue |
Omitted |
Returns the current value of the property specified in cProperty. |
0 |
Sets the property specified in cProperty to the default value. |
|
1 |
Sets the property specified in cProperty to the non-default value. |
|
nReturnValue |
Numeric |
Returns the new value of the specified property. |
This one's a documentation bug: The Help file shows the example for setting the PUTREF property by spelling out PROPERTY_PUTREF. It should be PUTREF, instead. |
Example |
* Turn off UNICODE conversion to ANSI. = ComProp(oRecordSet, "UTF8", 1) * Specify that VFP assign the object reference as * PROPERTY_PUTREF. = ComProp(oMyForm.OleControl1, "PUTREF", 1) |
See Also |