原来编过一个工程,里面用到了
CWindow cw;
cw.m_hWnd=GetSafeHwnd();
hDC=cw.GetDC();
编译通过。可是今天编了一个,就出现了错误,错误为:
d:\microsoft visual studio\vc98\atl\include\atlwin.h(65) : error C2065: '_Module' : undeclared identifier
d:\microsoft visual studio\vc98\atl\include\atlwin.h(2912) : error C2228: left of '.GetModuleInstance' must have class/struct/union type
d:\microsoft visual studio\vc98\atl\include\atlwin.h(2974) : error C2228: left of '.GetModuleInstance' must have class/struct/union type
D:\FRJanitor\FR\CameraOp.cpp(74) : error C2352: 'CWnd::GetSafeHwnd' : illegal call of non-static member function
d:\microsoft visual studio\vc98\mfc\include\afxwin.h(1912) : see declaration of 'GetSafeHwnd'
Error executing cl.exe.我已经
#include <atlbase.h>
#include <atlwin.h>
为什么会这样?????
还有,原来CClientDC dc(this);可以通过,现在也不行了,不知道为什么?那位大虾帮助一下,bow

解决方案 »

  1.   

    _Module 应该是stdafx.h中,是不是被删除掉了?
    extern CComModule _Module;
      

  2.   

    这是我的stdafx.h,麻烦看一下,谢谢// stdafx.h : include file for standard system include files,
    //  or project specific include files that are used frequently, but
    //      are changed infrequently
    //#if !defined(AFX_STDAFX_H__2FAA7322_B9EA_413F_B2FB_5A77FE97503F__INCLUDED_)
    #define AFX_STDAFX_H__2FAA7322_B9EA_413F_B2FB_5A77FE97503F__INCLUDED_#if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
    //extern CComModule _Module#include <afxwin.h>         // MFC core and standard components
    #include <afxext.h>         // MFC extensions
    #include <afxdisp.h>        // MFC Automation classes
    #include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
    #ifndef _AFX_NO_AFXCMN_SUPPORT
    #include <afxcmn.h> // MFC support for Windows Common Controls
    #endif // _AFX_NO_AFXCMN_SUPPORTextern CComModule _Module
    //{{AFX_INSERT_LOCATION}}
    // Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_STDAFX_H__2FAA7322_B9EA_413F_B2FB_5A77FE97503F__INCLUDED_)