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

Doc 里没法获得 Maifram 的控件指针

2012-09-10 
Doc 里无法获得 Maifram 的控件指针Doc 里无法获得 Maifram 的控件指针myshelllist *ml (myshelllist*)G

Doc 里无法获得 Maifram 的控件指针
Doc 里无法获得 Maifram 的控件指针
myshelllist *ml = (myshelllist*)GetDlgItem(AfxGetMainWnd()->GetSafeHwnd(),ID_FILELIST);

出错 hwnd为NLL

是什么问题?



[解决办法]
CWinApp 中的公有成员变量 m_pMainWnd 就是主框架的指针 
CMainFrame* pMainFrame = (CMainFrame*)(AfxGetApp()->m_pMainWnd); 
或者CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd();

热点排行