I am currently developing an application for Windows CE on the TI OMAP processor, which is an ARM processor. I am trying to simply call a function in a C++ DLL file from C# and I always get a value of 0 back, no matter which data type I use. Is this most likely some kind of calling convention mismatch? I am compiling the DLL and the main 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;
}