在vc ++ 6.0中基于对话框的应用程序的构造函数 [英] Constructor in case of dialog based application in vc++ 6.0

查看:292
本文介绍了在vc ++ 6.0中基于对话框的应用程序的构造函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不了解Dialog类中的构造函数(自动生成),为什么cWnd指针正在传递以及CDialog的作用是什么(cApp :: IDD,pParent)。我是vc ++的新手,可以请任何人详细告诉我(为什么这行包括CDialog(cApp :: IDD,pParent))



我是什么尝试过:



我在vc ++ 6.0中创建了一个Dialog,它的构造函数如下所示

cApp :: cApp(cWnd * pParent)

:CDialog(cApp :: IDD,pParent)

{

//有些初始化是

}

I didn't understand constructor(Auto generated)in Dialog class,why cWnd pointer is passing and what's the role of CDialog(cApp::IDD,pParent). I am new to vc++,can any one please tell me elaborately(why this line is included CDialog(cApp::IDD,pParent))

What I have tried:

I created one Dialog in vc++ 6.0,it's constructor like as follows
cApp::cApp(cWnd *pParent)
:CDialog(cApp::IDD,pParent)
{
//some initializations are there
}

推荐答案

请参阅 CDialog :: CDialog [ ^ ]。 cApp :: IDD 值由框架生成,并标识用于构建Dialog窗口的Dialog资源。 pParent 值是指向拥有Dialog的窗口的指针,并允许Windows在对话框可见时知道要停用哪个Window。
See CDialog::CDialog[^]. The cApp::IDD value is generated by the framework and identifies the Dialog resource that is used to build the Dialog's window. The pParent value is a pointer to the window that owns the Dialog, and lets Windows know which Window to deactivate when the Dialog is visible.


这篇关于在vc ++ 6.0中基于对话框的应用程序的构造函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆