Article ID: 120707
Article Last Modified on 7/1/2004
Process CPU Time Privileged User MyApp(0xb7) ...Here 0xb7 is the PID value of the application named MyApp.
MSVC -p 0xb7Or, start Visual C++ version 4.0 or later as follows:
MSDEV -p 0xb7NOTE: Beginning with Visual C++ 5.0, you can also attach to a process by selecting the following menu option:
Build::Start Debug::Attach to Process...When Visual C++ is loaded, look for statements in the status bar at the bottom of the screen stating that symbols for the application and its DLLs have been loaded. At this point, select the Debug menu, and choose the Break option to see the assembler listing in the main window. Bring up the call stack. Then double-click one of your functions. This brings up the source code for that source module in which a breakpoint can be set, or you can just open a source file and set a break point.
Hex PID -> [Not] -> (DEC) -> [Not] -> Dec PIDThe double negation is to trick calculator into giving you the correct number. Otherwise, it gives you the unsigned decimal equivalent of the hex number, which is well outside the valid PID range. In this example, you should get a Dec PID of -105277. The command line to attach, then, is simply:
start msdev -p -105277 -e -105277If you pass an invalid PID, you might receive an error like:
Additional query words: current running attach
Keywords: kbhowto kbbug kbide kbdebug KB120707