Changes 3 Static FILE declaration FOPEN (no FCLOSE), other ok class suddenly facing FOPEN return NULL

  • Thread starter Thread starter KeanHeng
  • Start date Start date
K

KeanHeng

Guest
Hi guys

Recently I encountered a weird problem as described above.

I tested on my Win10 OK, but face this in Production WinXP.

All the while the other class FOPEN was not facing any issues,


Until recently, new changes on following on another Class

1. Declared 3 STATIC FOPEN for different files, and no FCLOSE (was attempting to resolve writing into file 7MB 20k lines suddenly have missing records). only FFLUSH. THe idea was no need FOPEN and FCLOSE everytime when writing a line.


Suddenly...

1. Here's the interesting part... my other class using normal FOPEN FCLOSE trying to write a different file in another different class, return FOPEN NULL pointer.

2. All the while, this other class is working fine.

3. After I roll-back the STATIC AND everytime fopen and fclose, it becomes normal again.

MY questions

1. Why did WinXP and WIn10 (tested ok) behave differently for FOPEN?

2. Not sure if STATIC declaration for FILE* FOpen causing this weird problem?

Continue reading...
 
Back
Top