I have a third party dll that I want to use in a C# application. I have sample code in C++ including the function declarations and I've created a console application, modified with (I think) equivalent data types and my homegrown printf(). When I run the application it chokes at the first function call with a fatal exception,
FatalExecutionEngineError occurred
Cannot evaluate expression because a native frame is on top of the call stack.
The original prototype for the function is this
Which I translated to this
Can anyone give me directions to get this to work?
Thanks
Dave
FatalExecutionEngineError occurred
Cannot evaluate expression because a native frame is on top of the call stack.
The original prototype for the function is this
function declaration C++:
void __cdecl C_lin_coeff_batch(double z[], int32_t z_fpp, double theta[],
int32_t C_in[], bool inverse, int32_t C_fpp,
int32_t C_int_fpp, uint16_t method, int32_t
ci_mean_sel, double cc[], uint32_t cc_fpp[],
int32_t ccx[], double cci[], double best_fit[],
uint32_t cn_div[], uint32_t cn_shift[],
uint32_t n_samples, int32_t n_sample_x_devices,
int32_t n_cc, int32_t n_cn_div, int32_t n_cn_shift);
Which I translated to this
C# Dllimport:
[DllImport("linearize_r01.dll")]
public static extern void c_lin_coeff_dut(Int32[] C_in, double[] z, double[] theta,
Int32 C_fpp, Int32 C_int_fpp, Int32 z_fpp, int inverse,
ref double[] cc, ref UInt32[] cc_fpp, ref Int32[] ccx, ref double[] cci,
ref double[] error_vs_z, ref UInt32[] cn_div, ref Int32[] cn_shift,
Int32 n_samples, Int32 n_cc, Int32 n_cn_div, Int32 n_cn_shift);
Can anyone give me directions to get this to work?
Thanks
Dave