Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CFileDialog::OnOK()

Posted on 1998-06-22
3
Medium Priority
?
607 Views
Last Modified: 2013-11-20
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.
0
Comment
Question by:dlbrown051198
3 Comments
 
LVL 9

Accepted Solution

by:
Priyesh earned 100 total points
ID: 1318290
I am not familiar with 16 bit apps.. But u can call EndDialog or post WM_DESTROY to the dialog.
0
 

Author Comment

by:dlbrown051198
ID: 1318291
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.
0
 
LVL 3

Expert Comment

by:tma050898
ID: 1318292
Have you tried calling OnCancel instead.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question