Win32 GetOpenFileName prevents app from exiting

2

I'm using Win32 with C++ to make an app that can load the contents of files through a dialog with the GetOpenFileName function. Everything works fine, except when I close the main window and the app quits and prints this to the console:

The thread 'Win32 Thread' (0xa50) has exited with code 0 (0x0).

But the main process keeps running and I have to kill it explicitly in Visual Studio of the task manager, and I get this output:

The program '[2620] DBSCAN.exe: Native' has exited with code -1073741510 (0xc000013a).

Does the GetOpenFileName create a new thread that I have to terminate myself ? I've checked out the msdn and a few tutorials, I don't seem to be doing anything different than the standard usage, open a file, read content, close file.

I can post some code if needed, any help would be welcome.

Thanks

c++
visual-studio
user-interface
winapi
getopenfilename
asked on Stack Overflow Oct 25, 2010 by dotminic

1 Answer

0

try not setting an owner( ofnflags.hwndOwner = NULL ).

if you do set an owner, the occurring window will be threaded as a child window of the owner, which in turn would result in the behavior you are describing.

answered on Stack Overflow Jan 3, 2011 by P47RICK

User contributions licensed under CC BY-SA 3.0