T
Timothy Madden
Hello everybody !
I have a function in a dll that will write bytes of data in a log file.
The function has a local static FILE pointer like this:
void VMLogPacket(BYTE *pData, size_t nSize)
{
static FILE *dbg = fopen("pakets.log", "wbc");
if (dbg)
{
fwrite(...);
Currently I call _fcloseall() from the ExitInstance member function of my
application class, but this is not a very good aproach because the app has
to do cleanup for the internal work of the dll, beacause _fcloseall() is not
really a standard library function and I'm not sure if it actually
dealocates the FILE structure and because I might not want to close all
files after all.
My question is what is the right way to uninitialize the dbg file, that is
to close it ?
I have a function in a dll that will write bytes of data in a log file.
The function has a local static FILE pointer like this:
void VMLogPacket(BYTE *pData, size_t nSize)
{
static FILE *dbg = fopen("pakets.log", "wbc");
if (dbg)
{
fwrite(...);
Currently I call _fcloseall() from the ExitInstance member function of my
application class, but this is not a very good aproach because the app has
to do cleanup for the internal work of the dll, beacause _fcloseall() is not
really a standard library function and I'm not sure if it actually
dealocates the FILE structure and because I might not want to close all
files after all.
My question is what is the right way to uninitialize the dbg file, that is
to close it ?