Carbon events

Posts: 691
Joined: 2002.04
Post: #1
ok, I've got this event code (a modified quit handler)...
    EventTypeSpec    quitEvent[] = {kEventMouseDown};
    EventHandlerUPP    quitEventHandler;
    EventHandlerRef    quitEventHandlerRef;


quitEventHandler = NewEventHandlerUPP((EventHandlerProcPtr)do_QuitEventHandler);
InstallEventHandler(GetApplicationEventTarget, quitEventHandler, 1, quitEvent, NULL, quitEventHandlerRef);
which gives this error...
cannot implicitly convert
from: (struct OpaqueEventTargetRef *(*__pascal "Pascal")(void))
to : (struct OpaqueEventTargetRef *)
any suggestions people? I'm sure InstallEventHandler is the cause...

Mark Bishop
Quote this message in a reply
Posts: 5,143
Joined: 2002.04
Post: #2
GetApplicationEventTarget() with brackets. You have to call the function, not pass its address Smile
Quote this message in a reply
Posts: 691
Joined: 2002.04
Post: #3
heh, plus &quitEventHandlerRef. thanks OneSadCookie, I'd just been confused with passing functions as pointers to NewEventHandlerUPP() beforehand.

Mark Bishop
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [For David, aarku] Carbon Events OneSadCookie 4 5,051 Mar 5, 2013 10:20 PM
Last Post: SethWillits
  Carbon events in windowed/full screen mode. Help needed. Anton Petrov 1 3,535 Dec 18, 2008 05:35 AM
Last Post: DoG
  Simulating "system idle" events in Carbon applications ascotti 4 3,350 May 2, 2006 03:22 PM
Last Post: OneSadCookie
  Carbon Key Events Nickolei 7 4,885 Nov 17, 2002 03:37 PM
Last Post: codemattic
  Carbon Keyboard Events IBethune 7 5,522 Oct 22, 2002 05:58 AM
Last Post: IBethune