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. Problem in CWinApp::Initinstance of SDI App

Problem in CWinApp::Initinstance of SDI App

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++question
3 Posts 2 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.
  • M Offline
    M Offline
    Manfred Staiger
    wrote on last edited by
    #1

    In my SDI Application the following problem appeared all of a sudden: In the InitInstance function of the application class the following line // Dispatch commands specified on the command line if (!ProcessShellCommand(cmdInfo)) return FALSE; causes the error: Error creating empty document ! (Translation from german, so the english errortext may be slightly different) Tracing into the MFC code the error happens in the function CWinApp::ProcessShellCommand at the following statement: if (!AfxGetApp()->OnCmdMsg(ID_FILE_NEW, 0, NULL, NULL)) Does anybody else have had this problem and found a solution ??? MS

    P 1 Reply Last reply
    0
    • M Manfred Staiger

      In my SDI Application the following problem appeared all of a sudden: In the InitInstance function of the application class the following line // Dispatch commands specified on the command line if (!ProcessShellCommand(cmdInfo)) return FALSE; causes the error: Error creating empty document ! (Translation from german, so the english errortext may be slightly different) Tracing into the MFC code the error happens in the function CWinApp::ProcessShellCommand at the following statement: if (!AfxGetApp()->OnCmdMsg(ID_FILE_NEW, 0, NULL, NULL)) Does anybody else have had this problem and found a solution ??? MS

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      This happens due to failure of creating frame window. check your CMainFrame::PreCreateWindow function. It may returning FALSE. Narrow down the problem by commenting whole code in this function and un comment one by one. You will definitely get problem. else carry the same check on OnCreate() function. -- modified at 9:00 Monday 26th September, 2005

      M 1 Reply Last reply
      0
      • P prasad_som

        This happens due to failure of creating frame window. check your CMainFrame::PreCreateWindow function. It may returning FALSE. Narrow down the problem by commenting whole code in this function and un comment one by one. You will definitely get problem. else carry the same check on OnCreate() function. -- modified at 9:00 Monday 26th September, 2005

        M Offline
        M Offline
        Manfred Staiger
        wrote on last edited by
        #3

        Oh such a shit. I had some old code in the views PreCreateWindow function which fails at the current version of the project. And so the creation of the view fails. MS

        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