473,382 Members | 1,726 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,382 software developers and data experts.

Terminate an application

Hi,
I program with Visual C++ .NET 2003.

I have an application that I want to quit if a specific
date is passed. (the user will not choose Quit in the menu)

I want to terminate the application in the OnClose member
function of my CApplicationView class.

I have tried with various methods like
PostMessage(WM_DESTROY, 0, 0) or PostQuitMessage(0) without success.

Does anybody have suggestions ?

Thanks,

Claude

Nov 17 '05 #1
1 1359
PostMessage a WM_CLOSE to your main window (AfxGetMainWnd )

--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com
http://blog.voidnish.com
"Claude Gagnon" <cl**********@videotron.ca> wrote in message
news:uC**************@TK2MSFTNGP15.phx.gbl...
Hi,
I program with Visual C++ .NET 2003.

I have an application that I want to quit if a specific
date is passed. (the user will not choose Quit in the menu)

I want to terminate the application in the OnClose member
function of my CApplicationView class.

I have tried with various methods like
PostMessage(WM_DESTROY, 0, 0) or PostQuitMessage(0) without success.

Does anybody have suggestions ?

Thanks,

Claude


Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Aaron | last post by:
Hello, I have an application that has several threads and non-blocking client sockets. When I try to terminate the program, although the application window disappear, but the program instance...
1
by: san | last post by:
Hi, I have a C# windows application App.exe that uses a UI component from another dll that components.dll. Everything works fine except that when I close the window of App.exe the process does...
4
by: Dr. J | last post by:
How to terminate a blocked thread? In my form's "load" I launch a TCP listening thread that stays in an infinite loop waiting for incoming TCP packets. In this form's "closing" I try to...
2
by: PeteZ | last post by:
Hi, This may seem like a silly question but I'll ask anyway 8^) I have a C# Windows "Console Application" that when a fatal error occurs, I'll log the error and I then want to stop the...
3
by: Gustavo L. Fabro | last post by:
Greetings! I'm testing VS 2005 Beta 2, and I've compiled a program that runs just fine on my computer (where VS is installed). I've tried to run this same program on another computer (after...
2
by: Strahimir Antoljak | last post by:
Is it possible to prevent terminate the application (and how). I am aware of preventing the closing application, but here I mean on more violent cases when user tries to kill (terminate) the...
7
by: fyi85 | last post by:
I have 8.1.5 on Windows 2003, when I do from CLP with auto commit off: db2 update table set column=something and then db2 terminate and then db2 connect to db db2 select updated column from...
2
by: Draw | last post by:
I have an application, where I do connect, handle a few requests, and if for some reason, I lose connectivity, I detect that and loop(trying to reconnect) until I regain connection to the DB. My...
16
by: eflatunn | last post by:
Hi all, my problem is that the application doesn't terminate when I close the form using the close box on the caption bar. Actually it seems as if the program is closed but task manager's process...
2
by: cnsabar | last post by:
Hi., I am using the following code to terminate the any process by giving the process name as input... use Win32::Process::List; use Win32::OLE; $Win32::OLE::Warn = 3; $P =...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.