Microsoft KB Archive/892073

= You receive an &quot;error C2065&quot; error message when you try to compile an eMbedded Visual C++ 3.0 or 4.0 application =

Article ID: 892073

Article Last Modified on 10/4/2007

-

APPLIES TO


 * Microsoft eMbedded Visual C++ 3.0
 * Microsoft eMbedded Visual C++ 4.0

-



SYMPTOMS
When 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



CAUSE
This issue occurs because the application uses the #import statement. The #import statement functionality is not supported in eMbedded Visual C++.



WORKAROUND
To work around this issue, follow these steps:  In your application, open a common header file that contains the #import statement. For example, open the StdAfx.h file.  Insert the following function prototype declarations before the #import statement. void _com_issue_error(HRESULT hr); void _com_issue_errorex(HRESULT hr, IUnknown* pUnkn, REFIID riid); 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.
 * 1) import &quot;&quot; 
 * 1) include &quot;StdAfx.h&quot;

void _com_issue_error(HRESULT hr) {   //Insert a custom implementation, such as the following. TRACE( _T(&quot;Caught unhandled COM exception!\n&quot;) ); }

void _com_issue_errorex(HRESULT hr, IUnknown* pUnkn, REFIID riid) {   //Insert a custom implementation, such as the following. TRACE( _T(&quot;Caught unhandled COM exception!\n&quot;) ); }  Save the source file.</li> Compile your application.</li></ol>

<div class="moreinformation_section">

MORE INFORMATION
To download eMbedded Visual C++ 4.0, visit the following Microsoft Web site:

http://www.microsoft.com/downloads/details.aspx?FamilyID=1dacdb3d-50d1-41b2-a107-fa75ae960856

Microsoft eMbedded Visual C++ 3.0 is included with eMbedded Visual Tools 3.0. To download eMbedded Visual Tools 3.0, visit the following Microsoft Web site:

http://www.microsoft.com/downloads/details.aspx?familyid=f663bf48-31ee-4cbe-aac5-0affd5fb27dd

Keywords: kberrmsg kbtshoot kbprb KB892073

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.