I convert a binary file format to another one. The files here are huge ~90 Mb
so I am reading, converting and writting by small peaces (~60000 value at a time).
When running my application (SDI application (one form), no graphics just buttons and text) after reading, converting and writting several peaces, the window becomes white (all button and text disappear) and come back once the reading conversion and writting task is done... I have a progress bar included in the loop too that disappears.
I tried a this->invalidate() in my loop but the form still dissapear after few rounds like if there was a memory leaking issue in the code.

This problem occur only with my writting procedure not with the reading one:

Because I am new to the .NET framework. I am wondering if I used the filestream and binarywriter correctly?.. any idea? I tried flushing within the loops but it did not help.

lDataLenght may reach size of 20,000 values with m_EGData.Nb=3
FileStream* fileEG = new FileStream(strFileName,FileMode::Append);
BinaryWriter* binEG=new BinaryWriter(fileEG);
for (int i=0; i< lDataLenght; i++)
for(int j = 0; j < m_EGData.Nb; j++)
buffer=(short) (m_EGData[i+4*j]);