Citat:
ivan@elfak: za "null". To je manji problem jer mogu da postavim neki ref argument koji ne koristim.
Ne. Stavi IntPtr.Zero umesto null.
E sad, ako ti je u COM-u deklarisano ovako:
Code:
void FFT(BOOL Inverse, unsigned int NumSamples, double* ReIn, double* ImIn, double* ReOut, double* imIn, double* ImOut)
Probaj da deklarises (managed) funkciju ovako:
Code:
public static extern void FFT(bool Inverse, uint NumSamples, ref IntPtr ReIn, ref IntPtr ImIn, ref IntPtr ReOut, ref IntPtr ImOut);
A ulazne nizove inicijalizuj ovako:
Code:
double[] ReIn = new double[1024]; // recimo...
IntPtr buffer1 = Marshal.AllocCoTaskMem(Marshal.SizeOf(double) * ReIn.Length);
Marshal.Copy(ReIn, 0, buffer, ReIn.Length);
// tako i za ImIn, ReOut, ImOut -> buffer2, buffer3 i buffer4
FFT(inv, numSamp, ref buffer1, ref buffer2, ref buffer3, ref buffer4);
Marshal.Copy(buffer3, ReOut, 0, ReOut.Length);
// i sad radis sa ReOut ili sa cim vec oces
...
// na kraju
Marshal.FreeCoTaskMem(buffer1); // itd...
Probaj pa javi, ja nisam probao, samo sam bacio pogled u MSDN (
ovde) i "nasvrlj'o" ovo...
If it's a girl then they're gonna call it Sigourney, after an actress. If it's a boy, then they're gonna call it Rodney, after Dave!