Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 199942 - Last Review: November 21, 2006 - Revision: 3.1
BUG: Tstcon32.exe Cannot Invoke Method with BSTR* Parameter Type
This article was previously published under Q199942
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.
Microsoft has confirmed that this is a bug in Visual C++ 6.0 and Visual C++.NET ActiveX Control Test Container.
To work around this issue:
- Use containers such as Visual Basic.
- Use LPCTSTR as the parameter type.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Steps to Reproduce Behavior
- Use the MFC ActiveX ControlWizard to create an ActiveX control project.
- 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;
}
- Build the control project.
- Insert the control to the ActiveX Control Test Container of Visual C++ 6.0 or Visual C++.NET.
- 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++:
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++
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++, 32-bit Learning Edition 6.0
- Microsoft Visual C++ .NET 2002 Standard Edition
| kbbug kbnoupdate kbmisctools kbcontainer kbctrl KB199942 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate