Http://www.cnblogs.com/warensoft/archive/2011/12/09/warenosoft3d.html
The above article is a good explanation.
Simply record:
1. Notice that the DLL must be placed under the bin directory, otherwise you will not be prompted to find it. If you use a pointer to use the UNSAFE keyword, declare a DLL open function function name, parameters to keep.
[DllImport ("Dll_test.dll", CallingConvention = callingconvention.cdecl, CharSet = CharSet.Unicode)]
Public unsafe static extern void Initqrsdet (int pack_min);
[DllImport ("Dll_test.dll", CallingConvention = callingconvention.cdecl, CharSet = CharSet.Unicode)]
Public unsafe static extern void Find_rr_5minpack (short* in_data, int in_data_len, float* out_data, int* Out_data_len);
int outlen = 0;
float[] Outarray = new float[100000];
Fixed (short* inData = &ecgdata[0])
{
Fixed (float* outdata = &outarray[0])//Here pass an array of pointers to C # using a pointer to the keyword fixed lock integer pass the outdata pointer that adds a & sign callback is written directly to the OU Tarray array, the value of C + + callback is directly obtained by Outarray.
{
Split once in 5 minutes
Initqrsdet (5);
Find_rr_5minpack (InData, Ecgdata.length, Outdata, &outlen);
}
}
C # calls C + + when using pointers to pass