CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2003
    Posts
    79

    Prevent New Dialog from popping up

    In my SDI application I have three views connected ton one Document. The views are divided by splitters. On start up and when clicking new in the file menu a dialog pops up. This dialog wants the user to pick a view or document (I'm not sure which) in a list and press OK. I always pick the first choice in the list and press OK. I don't want this dialog to pop up. Does anyone know how to get rid of the dialog box?

  2. #2
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863
    In your InitInstance function of your FooApp class you should
    see
    PHP Code:
        // 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
    Change this to

    PHP Code:
        CCommandLineInfo cmdInfo;
        
    cmdInfo.m_nShellCommand CCommandLineInfo::FileNothing;
        
    ParseCommandLine(cmdInfo);

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

        
    FooDocTemplate->OpenDocumentFile(NULL); 
    Where FooDocTemplate is the desired doc template that was just created above
    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

  3. #3
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815
    That's probably one of the most often asked (and answered) questions here... There's even an article on that subject.

  4. #4
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863
    Well add me to the list of people who have answered it
    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

  5. #5
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815
    Originally posted by souldog
    Well add me to the list of people who have answered it
    Not really, I fear... You answered how to prevent a new document from being created on startup - but that was not the question...

  6. #6
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863
    Yup, my mistake. I was assuming the new file stuff would just
    be removed completely.
    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

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