Using Windows GetOpenFileName with SDL

Hi

I’m currently developing a windows application, that uses the build-in
functions GetOpenFileName(…) and GetSaveFileName(…). I’m experiencing
quite odd behaviour - with the newly opened windows getting closed
immediately.

I’ve done a hack that reopens the windows if the recieved path is of
zero-length, but I wonder what causes this, and if there is a cleaner
solution?

My sourcecode can be found at:
http://extraball.sunsite.dk/notepad.php?ID=6542

Kind regards,
\Mikkel Gjoel

Mikkel Gj?l wrote:

I’m currently developing a windows application, that uses the build-in
functions GetOpenFileName(…) and GetSaveFileName(…). I’m experiencing
quite odd behaviour - with the newly opened windows getting closed
immediately.

I faintly recall having had a similar problem one time. I’m not sure
whether it was exactly the same, but have a look at
http://cvs.sourceforge.net/viewcvs.py/pipmak/pipmak/source/pipmak_windows.c?rev=1.1.1.1&view=auto
to see how I fixed it. (By the way, I know just about zero about Windows
programming and am cross-compiling with Mingw on Mac OS X, so don’t ask
me any further questions. :slight_smile: )

-Christian