Carbon CFM callbacks for CFNetServices
Carbon CFM callbacks for CFNetServices
- Subject: Carbon CFM callbacks for CFNetServices
- From: "Dean Dauger" <email@hidden>
- Date: Mon, 20 May 2002 11:37:41 -0700
Hi All,
I'm trying to use CFNetServices from my Carbon CFM app written using CW Pro
6 and linked with CarbonLib 1.5. I have trouble with the callbacks,
specifically the CFNetServiceBrowserClientCallBack passed to
CFNetServiceBrowserCreate(). The code works while inside a Mach-O command
line executable, but, the crash occurs when I run the same code from inside
a Carbon CFM app.
From what I can tell, when CFNetServices attempts to inform me of a new
registration, the code crashes with an illegal instruction error because
CFNetServices attempted to call an obscure area of memory rather than my own
code. (I can tell by using gdb to report the stack info, and I can see that
the crash occured at an address consistent with that reported by my Carbon
code, but, according to gdb, my main() and other routines are in a
completely different part of memory, and the CF code is in yet another
part.) How do I give CFNetServices the correct procedure pointer?
Thanks!
Dean
P. S. My speculation is that I need to create the correct UPP for the
callback, much like how you would use NewModalFilterUPP to pass a filter
proc to ModalDialog(). I'm jumping through CFBundle-style hoops to call
CFNetService* routines, and I suspect my proc pointer isn't being
interpreted properly.
P. P. S. BTW, using CFBundleGetFunctionPointerForName did the trick for
those CFStringRef extern's! Thanks!
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.