Run an MFC application from console
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Run an MFC application from console

  1. #1
    Join Date
    Feb 2013
    Posts
    2

    Run an MFC application from console

    Hello,
    I have a question about to run an MFC dialog based C++ application from console:
    if I run my application from console, I see the application start and the console immediately back to prompt.
    I need that console wait the application exit before show me the prompt again.
    I tried on Visual Studio 6, 2005 and 2010 but the behavior is the same.
    Can anyone explain me if there is solution to avoid this?

    Thank you

    Rob

  2. #2
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,571

    Re: Run an MFC application from console

    Try this command in the console instead of simply entering your app's name:

    Code:
    start /wait <your app>
    See also http://technet.microsoft.com/en-us/l.../bb491005.aspx
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    5,883

    Re: Run an MFC application from console

    The behavior is standard in Windows command console. When you run GUI process, no matter MFC or not, command prompt returns immediately after process creation. To instruct console to wait for process finish start /WAIT command should be used explicitly.
    Best regards,
    Igor

  4. #4
    Join Date
    Feb 2013
    Posts
    2

    Re: Run an MFC application from console

    Thank you, it is a very simple solution

Tags for this Thread

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center