Microsoft KB Archive/199942

= BUG: Tstcon32.exe Cannot Invoke Method with BSTR* Parameter Type =

Article ID: 199942

Article Last Modified on 11/21/2006

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 6.0 Enterprise Edition

 Microsoft Visual C++ 6.0 Professional Edition

 Microsoft Visual C++ 6.0 Standard Edition

 Microsoft Visual C++ .NET 2002 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q199942

<div class="symptoms_section">

SYMPTOMS
The ActiveX Control Test Container (version 6.0.8063) that ships with Visual C++ 6.0 and Visual C++.NET fail to invoke a method of an MFC ActiveX control that has BSTR* parameter type.

<div class="cause_section">

CAUSE
Microsoft has confirmed that this is a bug in Visual C++ 6.0 and Visual C++.NET ActiveX Control Test Container.

<div class="resolution_section">

RESOLUTION
To work around this issue:
 * Use containers such as Visual Basic.
 * Use LPCTSTR as the parameter type.

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

<div class="moreinformation_section">

Steps to Reproduce Behavior
<ol> Use the MFC ActiveX ControlWizard to create an ActiveX control project.</li>  Add a method to the ActiveX control as follows: void CMyControl::Test(BSTR FAR* Par1) {        // TODO: Add your dispatch handler code here AfxMessageBox("In Test"); return 0; }                   </li> Build the control project.</li> Insert the control to the ActiveX Control Test Container of Visual C++ 6.0 or Visual C++.NET.</li> Invoke the Test method in the ActiveX Control Test Container and the message box does not appear. The following error is displayed in the output window of Visual C++:</li></ol>

First-chance exception in TSTCON32.EXE (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception. Warning: automation argument coercion failed. First-chance exception in TSTCON32.EXE (KERNEL32.DLL): 0xE06D7363: Microsoft C++

Keywords: kbbug kbcontainer kbctrl kbmisctools kbnoupdate KB199942

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.