Problem with _CrtSetReportHook with VS.2005
Hello! :D
I have a problem with _CrtSetReportHook (also i have the same problem with _CrtSetReportHook2)
I want to direct the debu output to a file..
so i made a function:
static int report(int reportType, char *message, int *returnValue)
in my class. And i add code to dump output to a file..
but the problem is that at the time it reaches the line:
FILE *fp = fopen("./CRTDebug.txt", "a+");
I get runtime error: Unhandled exception at 0xblablabla (msvcr80d.dll) in project.exe: 0xC000005: Access violation reading location 0xblablabla
and throws me a file "stream.c" pointing at this line:
/*
* if the stream is not inuse, return it.
*/
if ( !inuse( (FILE *)__piob ) ) {
Dont ask for the full source inside my function(report()).. it doesnt matter.
i tried to put only this line:
FILE *fp = fopen("./CRTDebug.txt", "a+");
and i get the same error again.
This is happening at visual studio 2005.
If i run it under visual studio 6 then its runing and dumping perfectly! so.. what is going on?
thanks for your time! :D
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement