Alek said:
sometimes a simple line code like
TCHAR *tRow = new TCHAR[tempSize];
cause an access violation.
What's problem?
The problem is, very likely, that your application has corrupted the heap by
over-indexing a heap allocation, or by modifying memory after you've
returned it to the heap (via delete or free).
The problem lies somewhere in your program - likely far away from the line
where the error is detected.
You might have better luck isolating the problem by running your application
under the full page heap. You can enable full-page heap for your
application by downloading & installing the latest Windows debuggers from
http://www.microsoft.com/whdc/ddk/debugging/default.mspx
and issue the command
c:\debuggers>gflags -i your_app.exe +hpa
from a command prompt (assuming you installed the debuggers into
c:\debuggers).
Note that the full-page heap won't detect all errors, because the VC++ CRT
does some of it's own heap management (holding onto larger blocks allocated
from the system heap and sub-allocating from those blocks).
-cd