two projects in 1 solution
-
in VC.net, I have a windows application( say project A) "call" another application ( say project B) using CreateProcess(....) approach to run a exe file generated in project B. A is startup project. It's OK to set breakpoint in the files of project A. but it's not OK to set breakpoint in file of project B. I know is project B generate DLL, then it's fine to set breakpoint in file of Project B. Is there anyone have this experience? :confused::rose:
-
in VC.net, I have a windows application( say project A) "call" another application ( say project B) using CreateProcess(....) approach to run a exe file generated in project B. A is startup project. It's OK to set breakpoint in the files of project A. but it's not OK to set breakpoint in file of project B. I know is project B generate DLL, then it's fine to set breakpoint in file of Project B. Is there anyone have this experience? :confused::rose:
The VS Debugger must "attach" to a process to debug it (hit breakpoints, etc.). Since Project B is launched via CreateProcess() and NOT from the debugger, so the debugger has no association be Project B and the executeable created with CreateProcess(). What you need to do is set a breakpoint right after CreateProcess(). Then, in another instance of VS, open the solution file, and goto "Debug"->"Processes". Select the recently launched executable and click "Attach".