Article ID: 892073 - Last Review: October 4, 2007 - Revision: 1.1

You receive an "error C2065" error message when you try to compile an eMbedded Visual C++ 3.0 or 4.0 application

System TipThis article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
Expand all | Collapse all

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:
  1. In your application, open a common header file that contains the #import statement. For example, open the StdAfx.h file.
  2. 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);
    #import "<sometypelibrary.tlb>"
  3. Save the header file.
  4. Open a source file that references the header file that you opened in step 1.
  5. 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") );
    }
  6. Save the source file.
  7. Compile your application.

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 (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 (http://www.microsoft.com/downloads/details.aspx?familyid=f663bf48-31ee-4cbe-aac5-0affd5fb27dd)

APPLIES TO
  • Microsoft eMbedded Visual C++ 3.0
  • Microsoft eMbedded Visual C++ 4.0
Keywords: 
kberrmsg kbtshoot kbprb KB892073
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.