Sign in to follow this  
Unreal

Problem with _CrtSetReportHook with VS.2005

Recommended Posts

Unreal    124
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[i] ) ) { 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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this