关于error C2039: 'StartDocW' : is not a member of 'CDC'的问题
我用的是VS2005,编译EVC工程时候出现了这样的问题:
1>.\GridCtrl_src\GridCtrlNew.cpp(5253) : error C2039: 'StartDocW' : is not a member of 'CDC'
1> D:\Program Files\Microsoft Visual Studio 8\VC\ce\atlmfc\include\afxwin.h(546) : see declaration of 'CDC'
1>.\GridCtrl_src\GridCtrlNew.cpp(5274) : error C2039: 'StartPage' : is not a member of 'CDC'
1> D:\Program Files\Microsoft Visual Studio 8\VC\ce\atlmfc\include\afxwin.h(546) : see declaration of 'CDC'
1>.\GridCtrl_src\GridCtrlNew.cpp(5332) : error C2039: 'EndPage' : is not a member of 'CDC'
1> D:\Program Files\Microsoft Visual Studio 8\VC\ce\atlmfc\include\afxwin.h(546) : see declaration of 'CDC'
1>.\GridCtrl_src\GridCtrlNew.cpp(5344) : error C2039: 'EndDoc' : is not a member of 'CDC'
1> D:\Program Files\Microsoft Visual Studio 8\VC\ce\atlmfc\include\afxwin.h(546) : see declaration of 'CDC'
跟踪了StartDocW,StartPage等在wingdi.h中定义如下:
WINGDIAPI int WINAPI AbortDoc(HDC);
WINGDIAPI int WINAPI EndDoc(HDC);
WINGDIAPI int WINAPI EndPage(HDC);
WINGDIAPI int WINAPI SetAbortProc(HDC, ABORTPROC);
WINGDIAPI int WINAPI StartDocA(HDC, CONST DOCINFOA *);
WINGDIAPI int WINAPI StartDocW(HDC, CONST DOCINFOW *);
WINGDIAPI int WINAPI StartPage(HDC);
#define LAYOUT_LTR 0
#define LAYOUT_RTL 1
WINGDIAPI DWORD WINAPI SetLayout(HDC , DWORD);
WINGDIAPI DWORD WINAPI GetLayout(HDC);
#ifdef UNICODE
#define StartDoc StartDocW
#else
#define StartDoc StartDocA
#endif // !UNICODE
// @CESYSGEN ENDIF
而在afxwin.h中的CDC的定义中确实是没有这些成员函数。该如何解决这个问题?将wingdi.h中的定义放入afxwin.h中吗?谢谢回答