山西黄飞波最新信息:请问VC++如何编写代码使系统在form运行之前自动弹出一个对话窗口?

来源:百度文库 编辑:中科新闻网 时间:2024/05/11 12:13:45
请问单文档界面,在运行时,想要在form前面先自动弹出一个对话窗口,该如何创建编写代码?
谢谢1楼。
我表述可能有些不太清楚,我是需要弹出一个dialogue。
比如想弹出一个需要验证用户名密码的对话窗口。
不是messagebox

在FORM的构造函数里放,如:
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
System::Windows::Forms::MessageBox::Show("Hello");
}

#include "MyDlg.h"
class CTestsplashApp : public CWinApp
{
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
CTestsplashApp();
MyDlg dlg;
.
.
.
.
.
.
.
.
}

BOOL CTestsplashApp::InitInstance()
{
// CG: The following block was added by the Splash Screen component.

int tt=dlg.DoModal();
if(tt!=IDOK)
return FALSE;
.
.
.
.
.
.
.
.
.

}