怎么实现点击一个按钮,打开相应对话框?菜鸟求救!!!! 我在CMainDlg添加了一个按钮(ID:IDC_SHOW),自己新插入一个Dialog(ID:IDD_PRINCIPLE)。请问,应该怎么做才能实现当我单击这个按钮,就会弹出我新建的对话框?本人菜鸟,还请高手指点详细步骤!!!毕设中遇到的困难,拜托了!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1.把新插入一个Dialog的生成一个类2.IDC_SHOW的消息函数中调用该类 CDialog dlg; dlg.DoModal(); STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); si.dwFlags |= STARTF_USESHOWWINDOW; si.wShowWindow = SW_SHOW; ZeroMemory( &pi, sizeof( pi ) ); char file[ 300 ] = "Explorer.exe "; strcat( file, "http://news.sina.com.cn" ); if( !CreateProcess( NULL, // No module name (use command line). file, // Command line. NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. 0, // No creation flags. NULL, // Use parent's environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi ) // Pointer to PROCESS_INFORMATION structure. ) { AfxMessageBox( "CreateProcess failed." ); } 模态:Dialog dlg;dlg.Domodal()'非模态:Dialog *dlg=new Dialog;dlg->Create(IDD_PRINCIPLE,NULL);dlg->ShowWindow(SW_SHOW); 求助:文件中字符串转数字 汽车在行使时用视频卡抓拍一张图片存储会出现重影现像,各位大侠有没有什么办法解决? 升星,散分!!!!!! 多播的可靠性--欢迎up 100分求解一个vc中判断目录是否存在的函数?高手指点!最好有例子! 怎么样调用一个外部的程序,并且得到这个外部程序的返回值啊?内部有详细说明啊! 关于Moden来电显示 请问,有关数据库和文件操作的问题! 如何获得LISTCTRL中所选项的行号? duilib listui 支持多选功能? 高手呢 ~关于自绘按钮的问题 已知树的句柄,如何得到这个句柄对应的项目的文本
2.IDC_SHOW的消息函数中调用该类
CDialog dlg;
dlg.DoModal();
PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
si.dwFlags |= STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOW;
ZeroMemory( &pi, sizeof( pi ) ); char file[ 300 ] = "Explorer.exe ";
strcat( file, "http://news.sina.com.cn" );
if( !CreateProcess( NULL, // No module name (use command line).
file, // Command line.
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi ) // Pointer to PROCESS_INFORMATION structure.
)
{
AfxMessageBox( "CreateProcess failed." );
}
dlg.Domodal()'
非模态:Dialog *dlg=new Dialog;
dlg->Create(IDD_PRINCIPLE,NULL);
dlg->ShowWindow(SW_SHOW);