I am currently developing a Windows CE application on the TI OMAP processor, which is an ARM processor. I am trying to just call a function in a C ++ DLL file from C # and I always get the value 0 back, no matter what data type I use. Is this likely some kind of inconsistency of the convening agreement? I am compiling a DLL and a basic EXE from the same Visual Studio solution.
C # code snippet:
public partial class Form1 : Form
{
private void button1_Click(object sender, EventArgs e)
{
byte test = LibWrap.test_return();
MessageBox.Show(test.ToString());
}
}
public class LibWrap
{
[DllImport("Test_CE.dll")]
public static extern byte test_return();
}
C ++ DLL code snippet:
extern "C" __declspec (dllexport) unsigned char test_return() {
return 95;
}
source
share