- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to debug a console app on Windows that it called by a VC++/VB UI via a batch file.
I've tried pointing to the batch file as the Command on the Debugging Properties tab along with the arguments passed to the batch from the UI. VS balked - the Command is required to be an EXE. I also determined what the arguments were, pointed to the target with the arguments but that fails as the console app asks for process ids from the UI, so the UI has to be active.
I've tried attaching to the UI process and then manipulating the UI to launch the console app (which it does by making a system call to the same batch file mentioned above). I thought I made sure the target was placed in the location where the UI was expecting to find it however a break point at the entry point was reached - I have to verify that the image I want the UI to access is the one I compiled. I've never attempted to debug this way - I just attached to the process of the UI and nothing more - there were no debug files available for the UI - not sure if I need them or where they would go (next to UI.exe?) or if there is anything else to do, or if I'm just SOL.
I'm resigning myself to resorting to a file to report intermediate value to debug - how archaic :-)
Any suggestions? Should I surrender? Need additional info?
Thanks
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Correction on the second paragraph - a breakpoint at the entry point was NOT reached.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could try using CMD.EXE as the executable, with the command line arguments being /K followed by the path to the script. Be sure to enclose the script path in quotes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can't you simply enter the information that is contained in your batch file to invoke the console app under the debugging properties of the Visual Studio solution for the console app and start the debugger from VS?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The batch file is not complicated but it has some steps prior to calling the console. I was able to get Steve's suggestion to work, but the success is limited - there are process IDs initiated by the parent process (the UI) that need to be referenced by the console app I'm trying to debug. I think my only option is to attached to the UI.
Thanks for the suggestions, though.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page