BUG: You may receive unexpected results when you use ATL automation components in a scripting client (315485)
The information in this article applies to:
- Microsoft Visual C++ 2005 Express Edition
- Microsoft Visual C++ .NET (2002)
This article was previously published under Q315485 SYMPTOMS
When you use attributed Active Template Library (ATL) automation components in a scripting client, you may receive unexpected results on a computer that is running Microsoft Windows 95, Microsoft Windows 98, or Microsoft Windows Millennium Edition (Windows Me).
CAUSE
Scripting engines resolve the function calls by internally calling the IDispatch::GetIDsOfNames implementation of the component. The ATL attribute provider generates the code for GetIDsOfNames for the component. This implementation calls the lstrcmpiW function to do the case insensitive string comparison. This function is not supported on computers running Windows 95, Windows 98, and Windows Me because of UNICODE dependency.
RESOLUTION
To resolve the problem, do one of the following:
- Do not permit the ATL attribute provider to generate the IDispatch implementation for your component. Instead, derive your class from IDispatchImpl, as in the following sample code:
class ATL_NO_VTABLE CMyComObject :
//public IMyComObject ,/*This is put by the wizard.*/
public IDispatchImpl<IMyComObject>,/*Use this, instead.*/
public IObjectSafetyImpl<CMyComObject ,
INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA>
-or-
- Do not use attributed code.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. REFERENCES
For more information, see the following articles in the Microsoft Developer Network (MSDN) Library:
Modification Type: | Major | Last Reviewed: | 1/6/2006 |
---|
Keywords: | kbbug kbpending KB315485 kbAudDeveloper |
---|
|