Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / June 2005



Tip: Looking for answers? Try searching our database.

Not Receiving quit AppleEvent under Tiger in PP

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bryan Christianson - 28 Jun 2005 06:45 GMT
I have a PP project that is working fine under Panther, but under Tiger
it is not receiving the quit AppleEvent when the application is shut
down. The application does quit, but none of my destructors are called
and LApplication::DoQuit() is definitely not being called.

It is almost like I had issued a kill from the command line

Is there anyway to trace what is happening here? The application is
built with PowerPlant as shipped with CW 8.3

Bryan
chris@repetematic.de - 28 Jun 2005 08:10 GMT
Hi Bryan,

i work with CW 8.3 to, but it works fine (most of the time).
Is it a Mach-0 Target, do you use Carbon-Events?

Gruß Chris

> I have a PP project that is working fine under Panther, but under Tiger
> it is not receiving the quit AppleEvent when the application is shut
[quoted text clipped - 7 lines]
>
> Bryan
Bryan Christianson - 28 Jun 2005 08:38 GMT
> Hi Bryan,
>
[quoted text clipped - 14 lines]
> >
> > Bryan

It is a Mach-0 target using WNE. I just did a test and found I can write
an AppleScript to Quit the application OK. It just doesnt get the
AppleEvent that should be generated by the Quit menu item.
James W. Walker - 28 Jun 2005 17:10 GMT
> It is a Mach-0 target using WNE. I just did a test and found I can write
> an AppleScript to Quit the application OK. It just doesnt get the
> AppleEvent that should be generated by the Quit menu item.

Is it possible that you are getting the kHICommandQuit Carbon Event?
(Just because you're using WNE doesn't mean that you don't have any
Carbon Event handlers.)
Bryan Christianson - 28 Jun 2005 22:59 GMT
> > It is a Mach-0 target using WNE. I just did a test and found I can write
> > an AppleScript to Quit the application OK. It just doesnt get the
[quoted text clipped - 3 lines]
> (Just because you're using WNE doesn't mean that you don't have any
> Carbon Event handlers.)

I dont think thats the case unless a default handler is being inserted
somehow. As I said, if I send a 'quit' from AppleScript and as I have
just found, use the Quit selection from the Dock popup menu, then the
apple event is sent and handled correctly.

Signature

Bryan

Bryan Christianson - 29 Jun 2005 01:52 GMT
> I have a PP project that is working fine under Panther, but under Tiger
> it is not receiving the quit AppleEvent when the application is shut
[quoted text clipped - 7 lines]
>
> Bryan

Problem solved - thanks for the pointers guys.

I setup a Carbon event handler (although this a WNE application) and it
seems to do the trick

static OSStatus quit_handler(EventHandlerCallRef inHandlerCallRef,    
EventRef inEvent, void *inUserData) {
   CAppearanceApp *app = (CAppearanceApp *)inUserData;      
   app->DoQuit();    
   return(0);
}

voidCAppearanceApp::SetupQuitHandler(void) {  
   EventHandlerUPP   handler;
   EventTypeSpec     eventList = { kEventClassApplication,
kEventAppQuit };

   handler = NewEventHandlerUPP(quit_handler);  
   InstallEventHandler(
       ::GetApplicationEventTarget(), handler, 1, &eventList, this,
NULL);
}
James W. Walker - 29 Jun 2005 05:49 GMT
> Problem solved - thanks for the pointers guys.

For the record, what exactly was the circumstance in which you did not
get the quit AppleEvent?  In one message you said "shut down", leading
me to think you were talking about the computer shutting down, and in
another message you mentioned the Quit menu item.
Bryan Christianson - 29 Jun 2005 12:39 GMT
> > Problem solved - thanks for the pointers guys.
>
> For the record, what exactly was the circumstance in which you did not
> get the quit AppleEvent?  In one message you said "shut down", leading
> me to think you were talking about the computer shutting down, and in
> another message you mentioned the Quit menu item.

Oh - sorry about the ambiguity. The problem was occurring when selecting
the Quit menu item from the application menu.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.