Re: Wrapping Callback Functions

new topic     » goto parent     » topic index » view thread      » older message » newer message

You can save some grief if you assign a type for the callbacks, so that you get notified when you try to look up an invalid c routine, otherwise, you have to check each one to see if it succeeds. Something like this, off the top of my head:

type handle(integer x) 
return x > -1 
end type 
 
handle xNewtonAllocMemory = define_c_func(dll,"+NewtonAllocMemory",{C_INT},C_POINTER) 
 
handle xNewtonFreeMemory = define_c_proc(dll,"+NewtonFreeMemory",{C_POINTER,C_INT})  
 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu