BUG: Tstcon32.exe Can't Invoke Method with BSTR* Parameter Type

ID: Q199942


The information in this article applies to:


SYMPTOMS

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


CAUSE

This is a bug in Visual C++ 6.0's ActiveX Control Test Container.


RESOLUTION

One workaround is to use containers such as Visual Basic. Another workaround is to use LPCTSTR as the parameter type.


STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Use the MFC ActiveX ControlWizard to create an ActiveX control project.


  2. 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;
       } 


  3. Build the control project.


  4. Insert the control to the ActiveX Control Test Container of Visual C++ 6.0.


  5. Invoke the Test() method in the ActiveX Control Test Container and the message box doesn't show up. The following error is displayed in the output window of Visual C++:


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++ Exception.


REFERENCES

(c) Microsoft Corporation 1999, All Rights Reserved. Contributions by Yeong-Kah Tam, Microsoft Corporation.

Additional query words:


Keywords          : kbole kbActiveX kbContainer kbCtrl kbMFC kbVC kbVC600bug kbDSupport 
Version           : winnt:6.0
Platform          : winnt 
Issue type        : kbbug 

Last Reviewed: March 7, 1999