Solved

CFileDialog::OnOK()

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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 …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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 explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now