Article ID: 198009
Article Last Modified on 6/2/2005
APPLIES TO
- Microsoft ActiveX Template Library 3.0, when used with:
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 5.0 Professional Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 6.0 Standard Edition
- Microsoft ActiveX Template Library 2.1, when used with:
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 5.0 Professional Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 6.0 Standard Edition
This article was previously published under Q198009
SYMPTOMS
Calling one of the string conversion macros, such as OLE2T
or T2OLE, inside a catch block of a try/catch exception handler causes an
access violation.
CAUSE
Some of the string conversion macros will call _alloca().
However, _alloca() cannot be used inside an exception handler.
RESOLUTION
Use MultiByteToWideChar() or WideCharToMultiByte() rather
than string conversion macros inside an exception handler.
STATUS
This behavior is by design.
REFERENCES
Visual C++ Online Documentation for _alloca()
(c) Microsoft Corporation 1998, All Rights Reserved. Contributions by Samson
Tanrena, Microsoft Corporation.
Additional query words: A2W A2CW T2OLE OLE2W A2OLE A2T T2W W2A W2CA OLE2T W2OLE
OLE2A T2A W2T
Keywords: kbtshoot kbprb kbexcepthandling KB198009