Method AutomationObject():setDBCConversion() Foundation

Enables or disables automatic string conversion.

Syntax
:setDBCConversion( <lEnabled> ) --> lOldSetting
Parameters
<lEnabled>
A logical parameter which specifies whether strings in method parameters, return and property values are automatically converted from and to UTF-16. If .T. (true) is specified in <lEnabled>, strings are automatically converted from ANSI or OEM to UTF-16 and vice versa. If .F. (false) is passed, the conversion is disabled and strings are used as-is. By default, automatic string conversion is enabled.
Return

:setDBCConversion() returns the old string conversion setting.

Description

By default, string values in method parameters, return and property values are automatically converted from ANSI or OEM encoding (see SET CHARSET) to UTF-16 before being passed to or read from the COM/ActiveX component. This conversion is required for interoperability because COM components use UTF-16-encoded strings internally.

For applications using strings which are already UTF-16-encoded, this automatic conversion can be disabled via the method :setDBCConversion(). In this case, strings are passed to the COM/ActiveX component as-is and no conversion occurs. Likewise, strings returned from the COM/ActiveX component are passed as UTF-16-encoded strings to the application.

Only UTF-16 strings can be used with a COM/ActiveX component for which string conversion is disabled. If a string with another encoding is passed to the COM/ActiveX component, a runtime error may occur or the method or property access may not work as expected.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.