After I release the document from memeory, I forget to set NULL to the document pointer. Then later when trying to do dynamic_cast, above dialog pops up.But It's not proved true by below code:{CTestSub* pSub = new CTestSub(); delete pSub; /*pSub =
1. The address assigned by Compiler is virtual address. Why? because compiler definitely has no way to decide the physical memory address ahead of running the program.2. My understanding of the process of visiting phycial memory of an application is:
We can attach the debugger onto any running process at any time. Two cases:1. Unhandled exception is thrown in some thread of a process. A dialog will pop up to ask user to terminate the process or debug it. If clicking OK, the process will be
The debug configuration of VC++ projects is the configuration that most debugging and development is done on. This is entirely appropriate because the debug information, lack of optimizations, and the extra debug checks in the Microsoft libraries,
In order to understand "delete this" : First Step------dive into "delete p"delete p 執行了哪兩個步驟?delete p 是一個兩步的過程:調用解構函式,然後釋放記憶體。delete p產生的代碼看上去是這樣的(假設是Fred*類型的):// 原始碼:delete p;if (p != NULL) { p->~Fred(); operator delete(p);} p->~Fred()
Description: The code you submitted on P4 seems in disorder even if you arrange it well on your own PC.For instance:1. Snapshot of the code on your screen2. But after you submitted itThe reason is that your code was NOT using the monospaced
Here, I just note about how to use AQTime to find the bottleneck of a dll module. Steps: 1. Create a new project. Set "Host Application", which is the execution module to load your dll. Note: Release version application should be used. 2
Better error/exception handling. 2 ways: a) return status upwards the function calling chain and have the top calling function process the status;b) not necessarily return the status but throw exception when something’s wrong, catch and process the
什麼是WinDBG?WinDbg是微軟開發的免費源碼級調試工具。Windbg可以用於Kernel模式調試和使用者模式調試,還可以調試Dump檔案。由於大部分程式員不需要做Kernel模式調試, 我在這篇文章中不會介紹Kernel模式調試。Kernel模式調試對學習Windows核心極有協助。如果你對此感興趣,可以閱讀Inside Windows