Visual Studio Debugging Tip - [8:10 AM]
Sara Ford: "if you double-click on any error or warning in the output window, you will jump directly to that location in the file (or the closest equivalent)" - Good tip. If you're interested in taking advantage of this sort of functionality in your own code, it's very easy.
Please note, the code below is very simplified, and for demonstration purposes only. You'd want to wrap this is a way that makes sense for your application. ATL and MFC provide this sort of stuff, but you can roll your own.
char buffer[MAX_PATH];
// Yes, I know this is an unsafe CRT call. :-)
sprintf(buffer, "%s(%d): Debug Message\n", __FILE__, __LINE__);
OutputDebugString(buffer);So what does that do? It will dump something similar the following to the Output window...c:\yoursource\yourfile.cpp(99): Debug Message
Now if you follow Sara's tip it will jump you right to the code that dumped out the message.
Labels: Development, Visual Studio, Windows
comment





