Hi Everybody

I am having trouble wrapping some third party C software into C# in particular implementing the callback function. The function to be wrapped is of the form:

long setCallbackFunction(long fn(const HSIF_DATA_PT *pD1, const long N1, const HSIF_DATA_PT*pD2, const long N2));

where HSIF_DATA_PT is a data structure for storing points.

As expected without implementing any changes I get the type:

public int setCallbackFunction( SWIGTYPE_p_f_p_q_const__HSIF_DATA_PT_q_const__long_p_q_const__HSIF_DATA_PT_q_const__long__long fn )

which is not very useful.


I have tried using the swig callback functions in the interface file so that:

long setCallbackFunction( long (*op) (const HSIF_DATA_PT * pD1, const long N1, const HSIF_DATA_PT * pD2, const long N2) );

%callback("%callback _cb")
long fn(const HSIF_DATA_PT * pD1, const long N1, const HSIF_DATA_PT * pD2, const long N2)
%nocallback

...however this doesn't seem to get me anywhere either.

If anybody could help me with this problem or point me in the right direction any help would be much appreciated!
Thanks