不用MFC 做基於對話框的程序,不像書上的 SDK 例子一樣在窗体中一個一個創建控件,用一個對話框資源創建窗体在 win32 Application  工程中要怎麼樣實現 ???我以下的做法對不對? 對的話要接著做什麼?怎麼做?(我在編譯時已經出錯了)A
新建一個 win32 Application 選擇 “A Sample Win32 Application”工程
B
然後 insert / resource  加入一個 Dialog / FormView資源. 保存些資源文件,把這個資源文件加入到工程中. 
C
View / ClassWizard 新建一個 .clw 文件 然后在新建一個類 Base Class 為 Cdialog 類 DialogID 為先前建的FormView資源的 ID

解决方案 »

  1.   

    to  zhucde(【风间苍月】)我找不到在 SDK 中用窗体資源創建對話框的例子,請發個例子給我,謝謝 !!mail:  [email protected]
      

  2.   

    創建一個基於對話框的程序.看一下代碼你就知道了.
    有一個繼承自CWinApp的類的全局對像.
    並在InitInstance里
    CDlgPreprintDlg 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
    } // Since the dialog has been closed, return FALSE so that we exit the
    //  application, rather than start the application's message pump.
    return FALSE;
    }