A
AM
Hi,
I have a C++ Dll that has a function that is being exported as
shown below
extern "C" __declspec(dllexport) validationResult __stdcall
_validateData(double dataToMat[], int time);
A structure is defined in the header(.h file) as shown below
struct validationResult
{
int rWaveValid; //validity of the WAVE
int signalStatusArray[4]; //validity of each of the channel data -
'causing the problems'
};
I need to call the above method from C# in where i have the following
structure defined
public struct validationResult
{
public int micDataValid; //validity of the microphone data
public int rWaveValid; //validity of the r Wave
public int[] signalStatusArray; //validity of each of the
channel data
};
And my function call is as shown
validationResult res = new validationResult();
res.signalStatusArray = new int[4];
res = _validateData(dataToMat, 2);
When the last line is reached i get an exception that says"Method's
type signature is not PInvoke compatible"
What am I doing wrong.
I know the issue is at the array inside the struct, as when I remove
the array from the C++ struct and the C# struct I get the right
response.
Thanks in Advance.
abhi M
I have a C++ Dll that has a function that is being exported as
shown below
extern "C" __declspec(dllexport) validationResult __stdcall
_validateData(double dataToMat[], int time);
A structure is defined in the header(.h file) as shown below
struct validationResult
{
int rWaveValid; //validity of the WAVE
int signalStatusArray[4]; //validity of each of the channel data -
'causing the problems'
};
I need to call the above method from C# in where i have the following
structure defined
public struct validationResult
{
public int micDataValid; //validity of the microphone data
public int rWaveValid; //validity of the r Wave
public int[] signalStatusArray; //validity of each of the
channel data
};
And my function call is as shown
validationResult res = new validationResult();
res.signalStatusArray = new int[4];
res = _validateData(dataToMat, 2);
When the last line is reached i get an exception that says"Method's
type signature is not PInvoke compatible"
What am I doing wrong.
I know the issue is at the array inside the struct, as when I remove
the array from the C++ struct and the C# struct I get the right
response.
Thanks in Advance.
abhi M