473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

VC++.Net, How to close an SDI application from a Dialog box?

Hello,

I have a problem I have been dealing with for a couple of days now.. any help would be greatly appreciated.

I have an SDI Application that opens first with appearance of a Dialog box..

The Dialog DoModal code is located in the initialization application function of the main application code:

CStatusDlg dlg;
dlg.DoModal();

then the SDI Window opens after I close the Dialog box.. again, no big deal. That is the way it is supposed to.

My problem.. I want the Dialog box to have an optional CONTOL HANDLER (Exit Button) to close the ENTIRE Application (including the Dialog Box) and PREVENT the SDI Window from opening..

So far I have been able to close the application in the Event Handler function with the following code:

m_pMainWnd->DestoyWindow();

Here I am using a Global pointer (variable) to effectively close everything..

THE PROBLEM.. upon execution the program throws an exception..

I think what is happening is that because the Dialog box is a child of the SDI
Mar 11 '07 #1
1 2576
I figured it out on my own.. works like a charm..

Bob
Mar 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: AA | last post by:
I have one more query but this time it is related with Windows Address Book(WAB). Suppose I open a link to WAB through my application's (developed in VC++) dialog box. Now, if I get the focus...
0
by: AA | last post by:
Hi All I have one query but it is related with Windows Address Book(WAB). Suppose I open a link to WAB through my application's (developed in VC++) dialog box. Now, if I get the focus back on...
0
by: nandha | last post by:
H I have a doubt in VC++ regarding file reading and displaying in the GUI (Dialog I have a binary file, which contains several piece of information , i have to read the information continuously...
2
by: m11533 | last post by:
I have written an application that runs as a subprocess of a service, where the service is a .NET C# Windows Service that simply starts the subprocess and then periodically checks that the subprocess...
0
by: savyasachi | last post by:
Hi everyobdy, Plz help me out on a prob. I'm facing a problem in my VC++ SDI application. Dialog resources I've declared in a dynamic DLL file and that I want to call from my DoModal() declared in...
1
by: 2yuexue | last post by:
I have a dialog application that is created using VC++ 6.0 and a Windows form application using .NET 2003. I'd like to access the Dialog from the form. I have tried every thing I know to write a...
1
by: dan.c.roth | last post by:
oForm.Close() vs this.Close() in a modal dialog. oFrom.Close() calls Form.Dispose() but this.Close() ,say in the click event of the Form, does not. I can think of the reason for this but is...
8
by: Daniele Piccinini | last post by:
Hi all, In my vc++ 2005 dialog based application i need to use a comunication activex component in a secondary thread: CFINSAxEFS* pNewAx = new CFINSAxEFS(); if ( !pNewAx->Create( NULL,...
4
by: San07 | last post by:
Hi All, I don't know whether this is the right place to post my query. Query: This is in VC++. I have created a blank Dialog-based project with VC++ 6.0. When I run, I am able to see the Dialog....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.