CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    26

    Please Answer This Code Gurus.



    How do I call up a CFormview dialog resource?


    My App is a SDI with Form View, I have used all the space I want to and now I need a new Form view ( empty ) to start putting more controls on. So I Insert a new dialog in my resouces as a formview dialog and then base the class on CFormView.


    I know how to call up a dialog "boz" with DoModal but what do I do to call up my new form?

  2. #2
    Join Date
    Mar 1999
    Posts
    9

    Re: Please Answer This Code Gurus.



    You can add your form view to your App's doctemplate in InitInstence(). For example:

    CMyApp::InitInstance()

    {

    // .......

    pDocTemplate = new CSingleDocTemplate(

    IDR_MAINFRAME,

    RUNTIME_CLASS(CMyDoc),

    RUNTIME_CLASS(CMainFrame), // main SDI frame window

    RUNTIME_CLASS(CMyFormView)); // your formview class

    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;

    }

    Normally, the cmdInfo.m_nShellCommand is "FileNew". So, your app will create a new form view for you at start up.

    Hope this will help. Good luck.


    Allen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured