Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to create a form or dailog in MFC-MDI ?

How to create a form or dailog in MFC-MDI ?

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++tutorialquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Patrick Tang
    wrote on last edited by
    #1

    In MFC-MDI, I create Dailog in MFC-MDI Maiframe, but tell me is error. In MFC-Dailog, create Dailog is No problem ; Help Help Help ;

    C P D 3 Replies Last reply
    0
    • P Patrick Tang

      In MFC-MDI, I create Dailog in MFC-MDI Maiframe, but tell me is error. In MFC-Dailog, create Dailog is No problem ; Help Help Help ;

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      Please post the (relevant) code. Please post the error message. Please read the forum guidelines. Please... :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      1 Reply Last reply
      0
      • P Patrick Tang

        In MFC-MDI, I create Dailog in MFC-MDI Maiframe, but tell me is error. In MFC-Dailog, create Dailog is No problem ; Help Help Help ;

        P Offline
        P Offline
        Patrick Tang
        wrote on last edited by
        #3

        I find error because I Create AboutDailog and i show this dailog; but AboutDailog code same of system create CAboutDlg : ----------AboutDailog.h--------------------- class AboutDailog : public CDialog { DECLARE_DYNAMIC(AboutDailog) public: AboutDailog(); virtual ~AboutDailog(); protected: DECLARE_MESSAGE_MAP() public: afx_msg void OnFileAbout(); }; ----------AboutDailog.cpp--------------------- // AboutDailog.cpp : 实现文件 // #include "stdafx.h" #include "MyControlTest.h" #include "AboutDailog.h" // AboutDailog IMPLEMENT_DYNAMIC(AboutDailog, CWnd) AboutDailog::AboutDailog() { } AboutDailog::~AboutDailog() { } BEGIN_MESSAGE_MAP(AboutDailog, CWnd) ON_COMMAND(ID_FILE_ABOUT, &AboutDailog::OnFileAbout) END_MESSAGE_MAP() // AboutDailog 消息处理程序 void AboutDailog::OnFileAbout() { // TODO: 在此添加命令处理程序代码 AboutDailog aboutDlg; aboutDlg.DoModal(); } ----------CAboutDlg.h--------------------- class CAboutDlg : public CDialog { public: CAboutDlg(); // 对话框数据 enum { IDD = IDD_ABOUTBOX }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 // 实现 protected: DECLARE_MESSAGE_MAP() }; ----------CAboutDlg.cpp--------------------- CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) { } void CAboutDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) END_MESSAGE_MAP() // 用于运行对话框的应用程序命令 void CMyControlTestApp::OnAppAbout() { CAboutDlg aboutDlg; aboutDlg.DoModal(); /*AboutDailog aboutDlg; aboutDlg.DoModal();*/ }

        E 1 Reply Last reply
        0
        • P Patrick Tang

          I find error because I Create AboutDailog and i show this dailog; but AboutDailog code same of system create CAboutDlg : ----------AboutDailog.h--------------------- class AboutDailog : public CDialog { DECLARE_DYNAMIC(AboutDailog) public: AboutDailog(); virtual ~AboutDailog(); protected: DECLARE_MESSAGE_MAP() public: afx_msg void OnFileAbout(); }; ----------AboutDailog.cpp--------------------- // AboutDailog.cpp : 实现文件 // #include "stdafx.h" #include "MyControlTest.h" #include "AboutDailog.h" // AboutDailog IMPLEMENT_DYNAMIC(AboutDailog, CWnd) AboutDailog::AboutDailog() { } AboutDailog::~AboutDailog() { } BEGIN_MESSAGE_MAP(AboutDailog, CWnd) ON_COMMAND(ID_FILE_ABOUT, &AboutDailog::OnFileAbout) END_MESSAGE_MAP() // AboutDailog 消息处理程序 void AboutDailog::OnFileAbout() { // TODO: 在此添加命令处理程序代码 AboutDailog aboutDlg; aboutDlg.DoModal(); } ----------CAboutDlg.h--------------------- class CAboutDlg : public CDialog { public: CAboutDlg(); // 对话框数据 enum { IDD = IDD_ABOUTBOX }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 // 实现 protected: DECLARE_MESSAGE_MAP() }; ----------CAboutDlg.cpp--------------------- CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) { } void CAboutDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) END_MESSAGE_MAP() // 用于运行对话框的应用程序命令 void CMyControlTestApp::OnAppAbout() { CAboutDlg aboutDlg; aboutDlg.DoModal(); /*AboutDailog aboutDlg; aboutDlg.DoModal();*/ }

          E Offline
          E Offline
          Eugen Podsypalnikov
          wrote on last edited by
          #4

          Patrick Tang wrote:

          but AboutDailog code same of system create CAboutDlg

          One constructor does not use any resource template ID... :)

          Check your definition of Irrationality[^] :) 1 - Avicenna 5 - Hubbard 3 - Own definition

          1 Reply Last reply
          0
          • P Patrick Tang

            In MFC-MDI, I create Dailog in MFC-MDI Maiframe, but tell me is error. In MFC-Dailog, create Dailog is No problem ; Help Help Help ;

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Patrick Tang wrote:

            ...but tell me is error.

            Are you keeping this error a secret or can you be bothered to share it with us?

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Man who follows car will be exhausted." - Confucius

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups