Adding An Initial Window - Programmer

This is a discussion on Adding An Initial Window - Programmer ; I have a dialog-based app that has a main window and one subsequent (child) dialog window. I just realized I need to add an initial welcome window which can also accept a piece of data from the user before getting ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Adding An Initial Window

  1. Adding An Initial Window

    I have a dialog-based app that has a main window and one subsequent
    (child) dialog window. I just realized I need to add an initial
    welcome window which can also accept a piece of data from the user
    before getting to my (current) main dialog app window.

    Is it difficult to add a beginning window previous to what is now my
    beginning window? I used VC++, and I'm not completely sure of how to
    insert a new beginning window (e.g. change the initializing and
    message mappings to allow for a new first window).

    Can I use an initial window and then destroy it, and call my current
    app? What's the easiest way?

    Thanks,

    Matt

  2. Re: Adding An Initial Window

    Create a dialog and got to your application's InitInstance method, before
    your current DoModal for the main dialog add the other dialog.

    BOOL CMyApp::InitInstance()
    {
    CSplashDlg SplashDlg;
    SplashDlg.DoModal();

    CMainDialog Dlg;
    Dlg.DoModal();

    return FALSE;
    }


    Ali R.

    "matt" wrote in message
    news:c2838b8f.0312281045.1514f62e@posting.google.c om...
    > I have a dialog-based app that has a main window and one subsequent
    > (child) dialog window. I just realized I need to add an initial
    > welcome window which can also accept a piece of data from the user
    > before getting to my (current) main dialog app window.
    >
    > Is it difficult to add a beginning window previous to what is now my
    > beginning window? I used VC++, and I'm not completely sure of how to
    > insert a new beginning window (e.g. change the initializing and
    > message mappings to allow for a new first window).
    >
    > Can I use an initial window and then destroy it, and call my current
    > app? What's the easiest way?
    >
    > Thanks,
    >
    > Matt




  3. Re: Adding An Initial Window

    Ali,

    Thanks for the reply. I tried what you said (make a dialog window and
    an associated class) but when I inserted those lines where you said,
    it said undeclared identifier at the CSplashDlg line. I had declared
    it as a class. What am I missing?

    Thanks,

    Matt

    "Ali R." wrote in message news:...
    > Create a dialog and got to your application's InitInstance method, before
    > your current DoModal for the main dialog add the other dialog.
    >
    > BOOL CMyApp::InitInstance()
    > {
    > CSplashDlg SplashDlg;
    > SplashDlg.DoModal();
    >
    > CMainDialog Dlg;
    > Dlg.DoModal();
    >
    > return FALSE;
    > }
    >
    >
    > Ali R.
    >
    > "matt" wrote in message
    > news:c2838b8f.0312281045.1514f62e@posting.google.c om...
    > > I have a dialog-based app that has a main window and one subsequent
    > > (child) dialog window. I just realized I need to add an initial
    > > welcome window which can also accept a piece of data from the user
    > > before getting to my (current) main dialog app window.
    > >
    > > Is it difficult to add a beginning window previous to what is now my
    > > beginning window? I used VC++, and I'm not completely sure of how to
    > > insert a new beginning window (e.g. change the initializing and
    > > message mappings to allow for a new first window).
    > >
    > > Can I use an initial window and then destroy it, and call my current
    > > app? What's the easiest way?
    > >
    > > Thanks,
    > >
    > > Matt


  4. Re: Adding An Initial Window

    matt wrote:
    > Ali,
    >
    > Thanks for the reply. I tried what you said (make a dialog window and
    > an associated class) but when I inserted those lines where you said,
    > it said undeclared identifier at the CSplashDlg line. I had declared
    > it as a class. What am I missing?
    >
    > Thanks,
    >
    > Matt
    >


    It means you did not #include "SplashDlg.h" in the app cpp file. You
    can never use a symbol in a cpp file that has not already been declared
    in that same cpp file. #include's read in the declarations.

    --
    Scott McPhillips [VC++ MVP]


  5. Re: Adding An Initial Window

    Scott,

    That's what I thought. But, I notice in such headers there are some
    weird and numbers and annotations. What would be an example of the
    bare minimum type of a header file I would need for a simple dialog
    window?

    Thanks,

    Matt

    "Scott McPhillips [MVP]" wrote in message news:<4LWdnd37s90JeG2iRVn-iw@comcast.com>...
    > matt wrote:
    > > Ali,
    > >
    > > Thanks for the reply. I tried what you said (make a dialog window and
    > > an associated class) but when I inserted those lines where you said,
    > > it said undeclared identifier at the CSplashDlg line. I had declared
    > > it as a class. What am I missing?
    > >
    > > Thanks,
    > >
    > > Matt
    > >

    >
    > It means you did not #include "SplashDlg.h" in the app cpp file. You
    > can never use a symbol in a cpp file that has not already been declared
    > in that same cpp file. #include's read in the declarations.


  6. Re: Adding An Initial Window

    I re-did the window again, and this time the header file was indeed
    created automnatically. So all I had to do then was add the #include
    statement and it worked.

    If I want to have a button on my second dialog window (previously the
    first) so that the window can be re-set (to the state it's in when I
    close the first window and initially get to this second window), how
    do I do this re-initialization (or re-creation) from a button in its
    own window?

    Thanks again,

    Matt

    "Scott McPhillips [MVP]" wrote in message news:<4LWdnd37s90JeG2iRVn-iw@comcast.com>...
    > matt wrote:
    > > Ali,
    > >
    > > Thanks for the reply. I tried what you said (make a dialog window and
    > > an associated class) but when I inserted those lines where you said,
    > > it said undeclared identifier at the CSplashDlg line. I had declared
    > > it as a class. What am I missing?
    > >
    > > Thanks,
    > >
    > > Matt
    > >

    >
    > It means you did not #include "SplashDlg.h" in the app cpp file. You
    > can never use a symbol in a cpp file that has not already been declared
    > in that same cpp file. #include's read in the declarations.


+ Reply to Thread