PRB: ActiveX Controls Passing Variant* Back to VFP Cause ErrorLast reviewed: December 5, 1997Article ID: Q177575 |
The information in this article applies to:
SYMPTOMSWhen calling a method in an ActiveX control built with Microsoft Foundation Classes (MFC), if there is an out parameter in the method with a type variant, Visual FoxPro returns a type mismatch error.
CAUSEWhen you call a method in the ActiveX control and pass it a variable by reference to receive a parameter value back from the ActiveX control, Microsoft Visual FoxPro seems to use a data type of BSTR. If the ActiveX method's parameter is defined as a Variant in the MFC based ActiveX control, this causes MFC to try and coerce the data types to match by using the VariantChangeType function. This function returns the type mismatch error.
RESOLUTIONControls built with the ActiveX Template Library do not have this problem. If you build the control in Microsoft Foundation Classes (MFC), avoid using out parameter data types of variant.
STATUSThis behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
Creating the server
Creating the Client
REFERENCESFor additional information, please see the following articles in the Microsoft Knowledge Base:
ARTICLE-ID: Q146219 TITLE : How To Register an OLE Custom Control (.OCX File) Manually ARTICLE-ID: Q139154 TITLE :OLE Control Licensing in Visual FoxPro Keywords : FxotherGeneral vfoxwin Version : WINDOWS:5.0,5.0a Platform : WINDOWS Issue type : kbprb |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |