Making sure data is saved on closing application
- From: "kizmet space adventures (remove 'not.' for emailing)" <pleasedo.not.mailme@xxxxxxxxxxxxxx>
- Date: Tue, 20 Dec 2005 19:56:13 GMT
Hi,
I have built myself the following application from 'Teach Yourself
Visual C++ in 21 Days' chapter 'Day 14 - Retrieving Data from an ODBC
Database'
http://serghei.net/docs/programming/c++/ty%20visualC++6%2021%20days/ch14/ch14.htm
The application lets you edit and add records to a database (as well
as just retreive them). The application uses recordset flags in code
to make sure that data is saved if you edit one record and move to
another. However, there is no code to make sure new or edited data is
saved when the application is exited.
After having poked about, I have found the ID_APP_EXIT event which I
can capture for the MainFrame class (IE it works when I select 'exit'
from the drop down menu), however, I haven't managed to find any way
of preventing the application from closing in order to perform an 'is
the data saved?' check when the 'cross' button at the top right hand
corner of the application is clicked.
I was hoping I could get some help here. Is this an MFC issue - or is
it a Windows API thing?
Thanks
.
- Follow-Ups:
- Re: Making sure data is saved on closing application
- From: Ian Semmel
- Re: Making sure data is saved on closing application
- From: kizmet space adventures (remove 'not.' for emailing)
- Re: Making sure data is saved on closing application
- From: Joseph M . Newcomer
- Re: Making sure data is saved on closing application
- From: AliR
- Re: Making sure data is saved on closing application
- From: Jonathan Wood
- Re: Making sure data is saved on closing application
- Prev by Date: Re: Dialog Apps and Accelerators
- Next by Date: Re: how to use "Findresource"
- Previous by thread: Re: topmost dialog
- Next by thread: Re: Making sure data is saved on closing application
- Index(es):