chhenning
2010-02-10 22:26:47 UTC
Hi there, I realize that my question probably cannot being answered
from this forum. But what I'm looking for is some guidance on how to
tackle my problem.
For some reason I believe my c++ runtime is messed up. The reason I
say that is that I get an endless loop of the following message when
calling fflush(...):
First-chance exception at 0x8018c470 in WorkerHost.exe: 0xC0000005:
Access violation at location 0x000000008018c470.
The code I using to trigger this problem is simply this:
FILE* f = fopen( "c:\\remove.txt", "w" );
fwrite( "Hello", 1, 5, f );
fflush( f );
fflush() function never returns. I have tried using ofstream from the
STL but same thing in the end. Only when I use Win32 calls like
CreateFile(), WriteFile(), etc. I have no problems.
This only occurs in my debug build and not in my release build. Also,
the problem does not occur with a simple Hello World program. The
application I'm trying to debug is a rather big one. Basically a .net
executable is forking of a C++ com module to do some work.
I believe this problem started to occur when I upgraded my VS2005 with
the SP1. Since then I have rebuild all the dependencies of my
application to avoid potential problems with having to deal with
different runtime linked with different modules. But no luck.
Is there anyone out there who could give me some hints on what I can
do about this? Also, in case this is the wrong forum please refer me
to the correct one.
Thanks a lot,
Christian
from this forum. But what I'm looking for is some guidance on how to
tackle my problem.
For some reason I believe my c++ runtime is messed up. The reason I
say that is that I get an endless loop of the following message when
calling fflush(...):
First-chance exception at 0x8018c470 in WorkerHost.exe: 0xC0000005:
Access violation at location 0x000000008018c470.
The code I using to trigger this problem is simply this:
FILE* f = fopen( "c:\\remove.txt", "w" );
fwrite( "Hello", 1, 5, f );
fflush( f );
fflush() function never returns. I have tried using ofstream from the
STL but same thing in the end. Only when I use Win32 calls like
CreateFile(), WriteFile(), etc. I have no problems.
This only occurs in my debug build and not in my release build. Also,
the problem does not occur with a simple Hello World program. The
application I'm trying to debug is a rather big one. Basically a .net
executable is forking of a C++ com module to do some work.
I believe this problem started to occur when I upgraded my VS2005 with
the SP1. Since then I have rebuild all the dependencies of my
application to avoid potential problems with having to deal with
different runtime linked with different modules. But no luck.
Is there anyone out there who could give me some hints on what I can
do about this? Also, in case this is the wrong forum please refer me
to the correct one.
Thanks a lot,
Christian