VC怎样设置初始启动对话框
比如有两个对话框资源:IDD_TRT_DIALOG1IDD_TRT_DIALOG2怎样设置IDD_TRT_DIALOG2为初始启动对话框?...
比如有两个对话框资源:
IDD_TRT_DIALOG1
IDD_TRT_DIALOG2
怎样设置IDD_TRT_DIALOG2为初始启动对话框? 展开
IDD_TRT_DIALOG1
IDD_TRT_DIALOG2
怎样设置IDD_TRT_DIALOG2为初始启动对话框? 展开
1个回答
展开全部
在APP类中定义调用,假设IDD_TRT_DIALOG1 对应的类为CTRTDlg1
IDD_TRT_DIALOG2 对应的类为CTRTDlg2 ,程序的APP类为CTestApp
在CTestApp的InitInstance()函数中添加
CTRTDlg2 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
}
如果该函数中有类似的其他对话框被调用了,则注释掉它
IDD_TRT_DIALOG2 对应的类为CTRTDlg2 ,程序的APP类为CTestApp
在CTestApp的InitInstance()函数中添加
CTRTDlg2 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
}
如果该函数中有类似的其他对话框被调用了,则注释掉它
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询