Link to home
Start Free TrialLog in
Avatar of dlbrown051198
dlbrown051198

asked on

CFileDialog::OnOK()

I have a problem with a subclassed dialog (derrived from CFileDialog) not closing when I call CFileDialog::OnOK().
After stepping through the code, it seems that the function uses some messages to know what exactly to do (pressing OK will not always close a FileDialog, it may just apply a filter to the filenames).  What I'm curious about is, are there any messages I can post to "force" the dialog to close??  Calling CDialog::OnOK() closes the dialog but after doing that a few times Windows runs out of memory and can no longer display the common dialog boxes.
This is a 16-bit app.
ASKER CERTIFIED SOLUTION
Avatar of Priyesh
Priyesh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dlbrown051198
dlbrown051198

ASKER

EndDialog() does indeed close the dialog box, but apparently because the CFileDialog::OnOK() does not actually close the box, the resources are forever leaked and eventually Windows 95 runs out of, what I call, it's "16-bit application" memory", causing all common dialogs (in any 16-bit application) to not display until    Windows 95 is restarted.
Have you tried calling OnCancel instead.