Solved

How to quit app at interrupt time?

Posted on 1997-05-11
2
206 Views
Last Modified: 2013-12-26
null
0
Comment
Question by:danieln
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:danieln
ID: 1291457
Edited text of question
0
 
LVL 1

Accepted Solution

by:
PAD earned 200 total points
ID: 1291458
You CAN'T quit an application from an Interrupt routine. This will works in some case but will freez your Mac in the other case.
At interrupt time, you're not sure that the current Heap is your application heap (and in fact often its was not). So as ExitToShell refer to the current application heap...

The best way to do that, i think is to use AppleEvent. You can send to your application a Quit Application event that willbe correctly executed. This a simple and you can find sample code on Apple Dev CD or on internet Apple Dev server.

The only thing to do is to make sure you store the process reference for your appl at beginning and store it in Global so that you can refer to this process serial number at interrupt time to launch an AppleEvent.

Another way is to build a thread that kill your application. And to make it sleep at startup. Then at interrupt time you just have to wake-up this thread, and this thread call exittoshell. You also have to store the global application process serial number.

Good luck...
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mixString challenge 36 137
Include multiple hostnames in this command? 3 56
has22 challenge 11 110
sumHeights  challenge 17 83
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…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

739 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