Solved

CFileDialog::OnOK()

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Different colored text in ComboBox without Subclassing 8 62
Expand LInux Boot partition remotly 3 91
wait notify demo infinite loop 3 114
Annoying "thing" blocks my view 4 101
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli‚Ķ
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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.

831 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