473,795 Members | 3,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 CApplicationVie w 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 1368
PostMessage a WM_CLOSE to your main window (AfxGetMainWnd )

--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com
http://blog.voidnish.com
"Claude Gagnon" <cl**********@v ideotron.ca> wrote in message
news:uC******** ******@TK2MSFTN GP15.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 CApplicationVie w 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
1111
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 is still here. When I run it in debug mode, "Stop debugging" button is still enabled. When I compile it and run it, the program is still listed in "Process" in the Task Manager.
1
6372
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 not terminate (I can see App.exe is the task manager). Also, I tried to see if control was returned to Main() after closing the UI (since Application.Run( myForm ) is used control should be returned to Main() once the UI is closed. This does not
4
4941
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 terminate this thread by calling the "Abort" funcion. But the thread does not terminate and after the form is closed this thread keeps running at blocked state. Basically the application keeps running because this thread does not terminate while...
2
8740
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 program in its tracks ie. terminate immeadiately. Is there a call to do this eg. Application.Terminate ();
3
11816
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 having installed MS .NET Framework 2.0 Beta 2 on it, from http://www.microsoft.com/downloads/details.aspx?FamilyId=7ABD8C8F-287E-4C7E-9A4A-A4ECFF40FC8E&displaylang=en), but got the following message:
2
1944
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 application process in the Windows Task Manager. Thanks, -- Strah @ Langan
7
8777
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 table the update is committed anyways, whereas the docs state that the update is supposed to be rolled back (auto commit is off) Does this indicate a bug or a mistake in the docs?
2
1761
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 problem is that after I do a EXEC SQL CONNECT.....<>; and after I detect the problem with connectivity...I do this EXEC SQL CONNECT RESET; EXEC SQL TERMINATE;
16
48475
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 list shows that it is not. There is one thread that I manully create and start in forms load event. But I set the IsBackground property of the thread to true. So, it should terminate while exiting the application. There are other threads that...
2
2507
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 = Win32::Process::List->new(); print "Enter the process name.exe to terminate: ";
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10437
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10214
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10164
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9042
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.