Problem with _CrtSetReportHook with VS.2005

Started by
1 comment, last by Unreal 18 years, 4 months ago
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
Advertisement
does the file exist allready?? try dropping the ./ infront of the filename.

Cheers
Chris
CheersChris
Don't notice the "a+".. the same is happen with "w". I drop the ./ i also create the file my self.. but nothing.. :/

This topic is closed to new replies.

Advertisement