Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to pass callback from mach-o to CFM



> I'm serching the way how to pass my callback function from Mach-o shlib
> to CFM App.
>
> If anyone know how to pass mycallback function from Mach-O to CFM App,
> please advice me your informations.

void * NewCFMFromMachO(void * inMachoFunctionPtr)
{
void * result = NewPtr(8);
((void**)result)[0] = inMachoFunctionPtr;
((void**)result)[1] = result;
return result;
}

void DisposeCFMFromMachO(void * inPtr)
{
if (inPtr != NULL)
DisposePtr((Ptr)inPtr);
}

// create a CFM function pointer to a Mach-O function
translatedFunctionPtr = NewCFMFromMachO((void*)YourOriginalMachoCallback);

// when you and the CFM app are all done with it
DisposeCFMFromMachO(translatedFunctionPtr);
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.