Thread View: comp.sys.mac.programmer.codewarrior
3 messages
3 total messages
Started by JollyRoger
Wed, 01 Nov 2000 16:35
NIL incoming AppleEvent in high level event handler?
Author: JollyRoger
Date: Wed, 01 Nov 2000 16:35
Date: Wed, 01 Nov 2000 16:35
34 lines
2455 bytes
2455 bytes
Can someone tell me what I am doing wrong here? I've got an application
where I install a few AppleEvent handlers, but when those handlers get
called, the AppleEvent parameter is always NIL.
I install the handlers like this:
err = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication,
NewAEEventHandlerUPP(AEOpenAppHandler), 0, false);
The handlers are prototyped like this:
OSErr AEOpenAppHandler(AppleEvent *theAppleEvent, AppleEvent *reply,
long refCon);
And this is one of the handlers:
OSErr AEOpenAppHandler(AppleEvent *theAppleEvent, AppleEvent *reply,
long refCon) {
AEDesc nameParam;
OSErr err;
err = AEGetParamDesc(theAppleEvent, keyDirectObject, typeBoolean,
&nameParam);
return noErr;
}
When put a breakpoint in the AEOpenAppHandler handler, theAppleEvent is
0 (NIL). What would make this happen? Something wrong with the way I
installed the handler? Something not set correctly in the SIZE resource?
I'm confused here. I've done everything the same way I would do it for
scripting additions; but it's not working like I expect.
Any help appreciated.
Re: NIL incoming AppleEvent in high level event handler?
Author: Reinder Verlinde
Date: Wed, 01 Nov 2000 20:43
Date: Wed, 01 Nov 2000 20:43
23 lines
2229 bytes
2229 bytes
[[ This message was both posted and mailed: see
the "To," "Cc," and "Newsgroups" headers for details. ]]
In article <KDXL5.27431$Fe4.699434@typhoon.austin.rr.com>, JollyRoger
<jolly-spam-bites-roger@pobox.com> wrote:
>
> Can someone tell me what I am doing wrong here? I've got an application
> where I install a few AppleEvent handlers, but when those handlers get
> called, the AppleEvent parameter is always NIL.
>
> ...
> The handlers are prototyped like this:
>
> OSErr AEOpenAppHandler(AppleEvent *theAppleEvent, AppleEvent *reply,
> long refCon);
>
Shouldn't that be
pascal OSErr AEOpenAppHandler(
AppleEvent *theAppleEvent, AppleEvent *reply, long refCon);
?
Re: NIL incoming AppleEvent in high level event handler?
Author: Jolly Roger
Date: Wed, 01 Nov 2000 23:26
Date: Wed, 01 Nov 2000 23:26
31 lines
2098 bytes
2098 bytes
In article <011120002143297955%reinder@mac.com>, Reinder Verlinde <reinder@mac.com> wrote: > [[ This message was both posted and mailed: see > the "To," "Cc," and "Newsgroups" headers for details. ]] > > In article <KDXL5.27431$Fe4.699434@typhoon.austin.rr.com>, JollyRoger > <jolly-spam-bites-roger@pobox.com> wrote: > > > > > Can someone tell me what I am doing wrong here? I've got an > > application > > where I install a few AppleEvent handlers, but when those handlers get > > called, the AppleEvent parameter is always NIL. > > > > ... > > The handlers are prototyped like this: > > > > OSErr AEOpenAppHandler(AppleEvent *theAppleEvent, AppleEvent *reply, > > long refCon); > > > Shouldn't that be > > pascal OSErr AEOpenAppHandler( > AppleEvent *theAppleEvent, AppleEvent *reply, long refCon); > > ? Duh! Now I feel stupid! Thank you very much! That solved the problem. JR
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads