Re: CreateCustomControl crash (Urs...?)
Re: CreateCustomControl crash (Urs...?)
- Subject: Re: CreateCustomControl crash (Urs...?)
- From: Urs Heckmann <email@hidden>
- Date: Sat, 26 Oct 2002 19:17:46 +0200
Am Freitag, 25.10.02, um 23:14 Uhr (Europe/Berlin) schrieb Howard Moon:
Later, making a second call to RegisterToolboxObjectClass actually
FAILS (with a -22080 result), which verify_noerr() ignores apparently.
Hi,
I have found a new way to deal with this without using static data
(which is not that easy in a plugin-driven environment).
I now use a manager object to resolve every call of a Carbon control
and direct events to appropriate callbacks of the different control
wrappers. In the manager class I register controls this way:
char defString[ 64 ];
UInt32 myAddress= (UInt32) this;
sprintf ( defString, "com.myGui.main%d.cntrl", myAddress );
verify_noerr(RegisterToolboxObjectClass (
CFStringCreateWithCString(NULL, defString, kCFStringEncodingISOLatin1
),
NULL,
4,
CEventList,
NewEventHandlerUPP (myControlHandler),
this,
&ControlClass));
If the control already exists (when forgotten to call
UnregisterToolboxObjectClass), the address is valid pointer to my class
and everything is fine. Still not elegant but obviously no pain...?
Cheers,
;) Urs
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.