MFC如何在单文档中添加对话框
来源:百度知道 编辑:UC知道 时间:2024/05/16 14:06:54
他是用MFC做的界面!
连着一个对话框,不知道怎么个连法?是在主程序框架的里面,还是在外面?这个对话框有标题条和边框吗?
如果在主框架的里面且没有标题条和边框,那它不是一个对话框,这种效果可以使用CFormView类,或者分割窗口来实现。
首先新建一个对话框资源,初始化程序实例是由InitInstance函数完成的。因此弹出这个对话框的代码也是放在这个函数里的。
代码如下:
BOOL CDlgTestApp::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
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Gene