Solved

CFileDialog::OnOK()

Posted on 1998-06-22
3
591 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 50 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Turn a spreadsheet into a vba executable. 2 92
Pressing cancel button with C# UI Automation 3 80
abstract class with all non abstract mentods 6 79
scoreUp challenge 14 63
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

790 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