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

    CWinApp:InitInstance PostQuitMessage

    I have determined that CMyApp::InitInstance() is not always called when my application begins execution. Anyone seen this kind of problem before? Perhaps I create the problem by using PostQuitMessage(0) to exit?

    Detail:
    I have an AfxMessageBox call as the very first line of CMyApp::InitInstance(). The first time I call my program using a command-line execution, CMyApp::InitInstance() is called, and the message box appears and the command line is processed and the program executes and exits. On subsequent calls from the command line, the program seems to skip InitInstance() somehow. It does not display the message box, it does not process the command-line, it simply turns on as if executed normally (double-clicked or whatever), or like it was already on and it is just unhiding. Is it possible I create the problem by using PostQuitMessage(0) to exit?


  2. #2
    Join Date
    Jun 1999
    Location
    Miami, FL
    Posts
    972

    Re: CWinApp:InitInstance PostQuitMessage

    Your situation sounds weird.

    Have you tried running it through the debugger? (You can specify the command line arguments in the Project Settings.)

    Good luck!


  3. #3
    Join Date
    Apr 1999
    Posts
    306

    Re: CWinApp:InitInstance PostQuitMessage

    You do not need to PostQuitMessage to terminate your app in the InitInstance(), just return FALSE.


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