Programming Delphi Project app.exe faulted with message: 'access violation at 0x40036887: read of address 0x00000010'. Process Stopped. Use Step or Run to continue
Notice: Undefined variable: relatedArticlesCount in /home/wwwroot/codeback.net/plugins/content/tags.php on line 149

When running your program, raise an error message, show as following(this message can be copied out by press Ctrl+C key when the error dialog prompt). One thing to make you very depressed was that you have carefully checked your codes many times while nothing found wrong.

---------------------------
Information
---------------------------
Project app.exe faulted with message: 'access violation at 0x40036887: read of address 0x00000010'. Process Stopped. Use Step or Run to continue.
---------------------------
OK  
---------------------------

Do not nervous, Delphi/C++Builder has provide an CodeGuard option. Select project->Options in your develop tools(Delphi or C-Builder), switch to the CodeGurard page, enable the CodeGuard Validate option. Debug your program again, see what happen. Following shows my program's deep error message caught by codeguard.

---------------------------
app.exe
---------------------------
Access violation at address 635F76A5 in module 'mshtml.dll'. Read of address 00000004.
---------------------------
OK  
---------------------------

---------------------------
Debugger Exception Notification
---------------------------
Project app.exe raised exception class EAccessViolation with message 'Access violation at address 40054855 in module 'rtl60.bpl'. Read of address 9BCD9BD5'. Process stopped. Use Step or Run to continue.
---------------------------
OK   Help  
---------------------------

This means the error was caused in the inner dll of microsoft's mshtml. Of course to debug the dll file has exceeded my ability. It also tell me that I have used an incorrect way to call the funtion of mshtml. So I improve my codes, and later I solved the problem.

CodeGuard provides runtime debugging for applications developed with C++Builder. It reports errors that are not caught by the compiler because they do not violate syntax rules. CodeGuard tracks Borland runtime libraries, with full support for multithreaded applications.

CodeGuard provides two principal types of coverage:

Memory and resource use. CodeGuard checks for faulty memory use, improper memory allocation or deallocation, invalid file streams or handles, and resource leaks caused by improper use of file streams or handles. It verifies pointers on dereference and checks pointer arithmetic. CodeGuard can report an error if your program tries to access memory or resources that have already been released.
 Function call validation. CodeGuard verifies function arguments and reports function failure as indicated by the function's return value. It validates Windows resource handles used in function calls.

To see a common access violation problems, check out Access violation at address 40A29D24. Read of address 00CB88C4 in C++Builder/Delphi programs


Add comment


Security code
Refresh

Programming - Delphi