deekpyro
2002.05.06, 05:51 PM
I'm working on a new emulator that is carbonized, but I'm having some difficulty with the Apple Quit Event Handler...
Here's my code...
pascal short AEQuit(const AppleEvent* aev, AppleEvent* reply, SInt32 refCon);
pascal short AEQuit(const AppleEvent* aev, AppleEvent* reply, SInt32 refCon)
{
Application.Terminate();
return noErr;
}
.......then later......
void NApplication::InstallAEHandlers()
{
short err;
AEEventHandlerUPP eventFunc;
/* eventFunc = NewAEEventHandlerUPP(AEQuit); */
err = AEInstallEventHandler(kCoreEventClass,kAEQuitAppli cation,eventFunc,0,false);
/* eventFunc = NewAEEventHandlerUPP(AEUnhandled); */
err = AEInstallEventHandler(kCoreEventClass,kAEOpenDocum ents,eventFunc,0,false);
err = AEInstallEventHandler(kCoreEventClass,kAEPrintDocu ments,eventFunc,0,false);
err = AEInstallEventHandler(kCoreEventClass,kAEOpenAppli cation,eventFunc,0,false);
}
The stuff commented it is what it's giving me a compiler error on. The compiler error is:
Error: function call 'NewAEEventHandlerUPP(pascal short (const AEDesc *, AEDesc *, long))' does not match 'NewAEEventHandlerUPP(pascal short (*)(const AEDesc *, AEDesc *, unsigned long))'
NApplication.cpp line 119 eventFunc = NewAEEventHandlerUPP(AEQuit);
and it says practically the same thing for the next one too.
Any thoughts?
Here's my code...
pascal short AEQuit(const AppleEvent* aev, AppleEvent* reply, SInt32 refCon);
pascal short AEQuit(const AppleEvent* aev, AppleEvent* reply, SInt32 refCon)
{
Application.Terminate();
return noErr;
}
.......then later......
void NApplication::InstallAEHandlers()
{
short err;
AEEventHandlerUPP eventFunc;
/* eventFunc = NewAEEventHandlerUPP(AEQuit); */
err = AEInstallEventHandler(kCoreEventClass,kAEQuitAppli cation,eventFunc,0,false);
/* eventFunc = NewAEEventHandlerUPP(AEUnhandled); */
err = AEInstallEventHandler(kCoreEventClass,kAEOpenDocum ents,eventFunc,0,false);
err = AEInstallEventHandler(kCoreEventClass,kAEPrintDocu ments,eventFunc,0,false);
err = AEInstallEventHandler(kCoreEventClass,kAEOpenAppli cation,eventFunc,0,false);
}
The stuff commented it is what it's giving me a compiler error on. The compiler error is:
Error: function call 'NewAEEventHandlerUPP(pascal short (const AEDesc *, AEDesc *, long))' does not match 'NewAEEventHandlerUPP(pascal short (*)(const AEDesc *, AEDesc *, unsigned long))'
NApplication.cpp line 119 eventFunc = NewAEEventHandlerUPP(AEQuit);
and it says practically the same thing for the next one too.
Any thoughts?