You receive an "error C2065" error message when you try to compile an eMbedded Visual C++ 3.0 or 4.0 application (892073)
The information in this article applies to:
- Microsoft eMbedded Visual C++, Version:3.0
- Microsoft eMbedded Visual C++, Version:4.0
SYMPTOMSWhen you try to compile a Microsoft eMbedded Visual C++ 3.0 or eMbedded Visual C++ 4.0 application, you may receive one or more of the following compiler error messages: error C2065: '_com_issue_error' : undeclared
identifier error C2065: '_com_issue_errorex' :
undeclared identifier CAUSEThis issue occurs because the application uses the #import
statement. The #import statement functionality is not supported in eMbedded Visual C++.WORKAROUNDTo work around this issue, follow these steps:
- In your application, open a common header file. For example, open StdAfx.h.
- Insert the following function prototype declarations before
the #import directive:
void _com_issue_error(HRESULT hr);
void _com_issue_errorex(HRESULT hr, IUnknown* pUnkn, REFIID riid);
#import "sometypelibrary.tlb" - Save the header file.
- Open a source file that references the header file that you opened in step
1.
- Use the following code sample for the _com_issue_error and
_com_issue_errorex functions in this source file. For example, your code may
be similar to the following code sample.
#include "StdAfx.h"
void _com_issue_error(HRESULT hr)
{
//Insert a custom implementation, such as the following.
TRACE( _T("Caught unhandled COM exception!\n") );
}
void _com_issue_errorex(HRESULT hr, IUnknown* pUnkn, REFIID riid)
{
//Insert a custom implementation, such as the following.
TRACE( _T("Caught unhandled COM exception!\n") );
} - Save the source file.
- Compile your application.
Modification Type: | Major | Last Reviewed: | 1/21/2005 |
---|
Keywords: | kberrmsg kbtshoot kbprb KB892073 kbAudDeveloper |
---|
|