Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Objective-c > Extract functio...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 912 of 1009
Post > Topic >>

Extract function pointers from function table

by kebabklubben.emp@[EMAIL PROTECTED] Sep 27, 2007 at 05:34 AM

Hi!

I'm quite new to Objective-C, and now I'm trying to get it to interact
with older C-code compiled to a Win32 dll. (All work is on PC with
GNUStep.)

One of my old C-functions requests a function pointer of type
Do_SFXP_Buffer_Allocate_t as input, and the function pointer type is
declared as:

typedef BufferHeader_t*(* Do_Buffer_Allocate_t)(const uint16
NoOfChannels);

I have now written a method in Objective C whos interface looks like
the expected C-interface. (Is the function the same with first input
argument and output in register 0?)

How can I extract the function pointer to my Obj-C function and use it
as input to my C-function? (I'm using the NS-cl*****...)

-(BufferHeader_t*)AllocateBufferWithChannels:(const
uint16)nNoOfChannels
{
....
}

-(Do_Buffer_Allocate_t*)getAlloccateBufferFunctionPointer
{
  return ??? /In pure C: &AllocateBufferWithChannels;
}

Best regards
Andreas Lundgren - Sweden
 




 3 Posts in Topic:
Extract function pointers from function table
kebabklubben.emp@[EMAIL P  2007-09-27 05:34:12 
Re: Extract function pointers from function table
Michael Ash <mike@[EMA  2007-09-27 08:24:23 
Re: Extract function pointers from function table
kebabklubben.emp@[EMAIL P  2007-09-28 00:11:32 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 23:50:45 CDT 2008.