Re: Quit-RelaunchFinder ( anErr = -600 procNotFound )
Re: Quit-RelaunchFinder ( anErr = -600 procNotFound )
- Subject: Re: Quit-RelaunchFinder ( anErr = -600 procNotFound )
- From: John Stiles <email@hidden>
- Date: Wed, 16 May 2007 07:48:53 -0700
You can't send an appleevent to a process that doesn't exist.
Check MacErrors.h for descriptions of errors like "procNotFound".
Also, this is not a Cocoa question in any way. Try the Carbon list.
Francis Derive wrote:
Hello all!
I have a little app which start by quitting Finder ( thanks to Sample
demonstrating quitting Finder at
http://developer.apple.com/technotes/tn2002/downloads/tn2062_2.hqx )
and I want it, at some point of the app, to re-launch Finder ( It
helps :) ).
For this I have copy/pasted the code for QuitFinder() and thought it
would be clever enough to change the constant kAEQuitApplication to
the constant kAEOpenApplication.
This doesn't work.
Before I learn enough about these "AE" things, could anyone help ?
Francis
PS : I get anErr = -600 (procNotFound) in the debugger.
OSErr LaunchFinder() {
[...]
//Building the Apple event
anErr = AEBuildAppleEvent( kCoreEventClass,
kAEOpenApplication,
typeApplSignature,
&kFinderProcessSignature,
sizeof(OSType),
kAutoGenerateReturnID,
kAnyTransactionID,
&tAppleEvent,
&tAEBuildError,
"");
if (noErr == anErr)
{
// Send the event.
anErr = AESend( &tAppleEvent, &tReply, kAENoReply |
kAEAlwaysInteract, kAENormalPriority, kNoTimeOut, nil, nil );
// always dispose of AEDescs when you are finished with them
(void) AEDisposeDesc(&tAppleEvent);
}
return anErr;
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden