Sunday, 15 June 2014

exception - C# callback function passing array -



exception - C# callback function passing array -

there c code written access electronic device. however, need write code in c# access electronic device.

c code step:

setpositioncallback( devno, positioncallback, 2 );

the positioncallback function called.

static void positioncallback( unsigned int devno, unsigned int count, unsigned int index, const double * const pos[3], const bln32 * const mrk[3] )

in above code setpositioncallback - calls positioncallback gives info through pos , mrk variable.

now when write code in c# doing same job, facing problem in calling positioncallback- marshal error , exception code: c0000005 , code crashes.

please can help me replicate in c# there in c positioncallback function?

public void positioncallback(uint devno,uint count,uint index,ref system.intptr pos,ref system.intptr mrk)

taken help of pinvoke

c# exception callback

No comments:

Post a Comment