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

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. For example, open StdAfx.h.
  2. 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"
  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: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:

Modification Type:MajorLast Reviewed:1/21/2005
Keywords:kberrmsg kbtshoot kbprb KB892073 kbAudDeveloper