| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 478 人关注过本帖
标题:[求助]关于mfc的两个小问题
只看楼主 加入收藏
*明华锐达*
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2007-2-7
收藏
 问题点数:0 回复次数:2 
[求助]关于mfc的两个小问题

请问下高手,这个基于对话框的程序里,m_pMainWnd这个成员变量是哪里来的,我在其生成的文件里没找到,是不是从CWinApp继承来的,我查了基类也没有这个成员,还有一个问题,这个
void CTesDlg::OnPaint() 在程序里的是什么时调用的,是不是在重绘时调用,不过我在那设了个断点,窗口切换时也没有调用,望指教!先在此谢过!
BOOL CTesApp::InitInstance()
{
AfxEnableControlContainer();

// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.

#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif

CTesDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}

// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}

搜索更多相关主题的帖子: mfc 
2007-02-09 21:23
danteago
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-2-9
收藏
得分:0 
应该是CWnd类中定义了该变量,比如你用 CDialog dlg(pParent)指针pParent会传给该变量
2007-02-09 23:24
*明华锐达*
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2007-2-7
收藏
得分:0 
CWnd只有m_hWnd 一个数据成员呀,InitInstance()是CWinApp的成员函数啊,怎可能直接用CWnd类中定义的成员变量

2007-02-10 14:59
快速回复:[求助]关于mfc的两个小问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017695 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved