如何在MFC程序中添加一个登陆框

it2022-05-09  26

新建一个DIALOG,同时新建窗口类CDLGTEST在应用程序的CCChapter13AApp::InitInstance()函数中做如下修改即在创建主框架之前显示CDLGTESTBOOL CCChapter13AApp::InitInstance(){ 。。。。。。。

 LoadStdProfileSettings();  // Load standard INI file options (including MRU)

 // Register the application's document templates.  Document templates //  serve as the connection between documents, frame windows and views.

 CDLGTEST dlgTest; if(dlgTest.DoModal() == IDOK) {  CSingleDocTemplate* pDocTemplate;  pDocTemplate = new CSingleDocTemplate(   IDR_MAINFRAME,   RUNTIME_CLASS(CCChapter13ADoc),   RUNTIME_CLASS(CMainFrame),       // main SDI frame window   RUNTIME_CLASS(CCChapter13AView));  AddDocTemplate(pDocTemplate);

  // Parse command line for standard shell commands, DDE, file open  CCommandLineInfo cmdInfo;  ParseCommandLine(cmdInfo);

  // Dispatch commands specified on the command line  if (!ProcessShellCommand(cmdInfo))   return FALSE;

  // The one and only window has been initialized, so show and update it.  m_pMainWnd->ShowWindow(SW_SHOW);  m_pMainWnd->UpdateWindow();  }                             return TRUE;}

转载于:https://www.cnblogs.com/nanshouyong326/archive/2009/08/11/1543645.html


最新回复(0)