CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2013

    Run an MFC application from console

    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


  2. #2
    Join Date
    Jun 2010

    Re: Run an MFC application from console

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

    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
    Voronezh, Russia

    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,

  4. #4
    Join Date
    Feb 2013

    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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.