27
Reply

PInvoke Error for FFTW

Chris Foley

Chris Foley

Sep 10 2010 10:07 AM
16.5k
Major Problem....This code consistently generates an unbalanced stack error.  I have even tried to change the Wrapper class argument to an IntPtr and that does not work....I am stumped....the "suggestion" is that my parameters do not match the number of arguments expected by the dll.  Anyone used this wrapper class before?  Any Problems?


ANSI C base function in the dll is:
      void *fftwf_malloc(size_t n);
Wrapper Implementation for PInvoke is:
      IntPtr malloc(int length);                     //in a wrapper class called fftw
My code simply calls:
      fftw.malloc(1000);                                //hardcoded test to see why this is failing...
   fftw.malloc(FFTSampleSize*sizeof(float)*2);       //where FFTSampleSize is a int 




Answers (27)