首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

CDC类有关问题,声明一个CDC对象,竟然找不到GetDC()成员函数?

2012-02-03 
CDC类问题,声明一个CDC对象,竟然找不到GetDC()成员函数??CDC *pDCCDC::GetDC()编译错误:error C2039: G

CDC类问题,声明一个CDC对象,竟然找不到GetDC()成员函数??
CDC * pDC=CDC::GetDC();

编译错误:
error C2039: 'GetDC' : is not a member of 'CDC'
d:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(636) : see declaration of 'CDC'
error C2660: 'GetDC' : function does not take 0 parameters

[解决办法]

探讨
是这样的,我的CDC对象是声明在主程序类的一个自定义成员函数中的,代码如下:
void CGISApp::CGIS_ReadFile(CString filename)
{
............

CDC *pDC = this->GetDC();

............

}
我用CDC *pDC = this->GetDC();后,编译错误为error C2039: 'GetDC' : is not a member of 'CGISApp'

其中CGISApp为主程序类,继承于CWinApp

热点排行