Blood-HaZaRd Blood-HaZaRd - 4 years ago 76
C++ Question

How Debug program called by another program

I Have written Two programs in C++, A and B. In the A program I call B with arguments (console Based Program).

What I want is when I call B want to be in the debug mode (known that I run the program A). How could I set that in the Visual Studio 2010 ?

Thank you

Answer Source

When I have had the same issue I just added Sleep(10000); (or similarly) at the start of program B and then manually attached a debugger. You can also make that conditional on an environment variable/command line argument/...

I know that it is a hack - but it sort of works; and would also prefer a better solution.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download