Hi all!!
I am developing an app for a Pocket PC platform on C#. However, I need to make use of a C written dll. The problem arises when calling the function
.........
int capture_input( float32 ***cepstrum, int nrOfSeconds, int playBack, int *nrOfCoeff );
.........
where it returns an int (not an error code), a bidimensional array allocated within the function (cepstrum) and another integer (nrOfCoeff). I call the function from C# managed code using the following declaration and code:
.........
[DllImport ( "JanitorMobiledll.dll", EntryPoint = "capture_input" )]
private static extern int capture_input ( float[,] cepstrum, int nrOfSeconds,
int playback, ref int nrOfCepstra );
.........
int numberOfFrames = 0;
int numberOfCepstra = 0;
float[,] cepstrum;
.........
numberOfFrames = JHandShaker.capture_input ( cepstrum, maxNrOfSeconds, 1, ref numberOfCepstra );
.........
The problem arises in the unmanaged code when redirecting the received pointer to the allocated memory region (*cepstrum=tmp_cep;).
What am I doing wrong??
Thanks!!!!