hello,
My code is this:
#include
typedef struct CalTest{
int x;
int y;
}OurType;
extern "C"{
_declspec(dllexport) OurType MyFun(int a,int b){OurType ot;/*Do some processing.*/ot.x=a; // Assumed to be aot.y=b; // Assumed to be breturn ts;}
}
In addition, What types can accept its(OurType)in c#?
Thanks.

VulpesPosted Feb 16, 2014, 11:22 AM
Ken HPosted Feb 16, 2014, 9:18 PM
Thank for you,Vulpes. :)
Ken HPosted Feb 16, 2014, 1:37 AM
Dll source codes:
C Sharp codes:
[StructLayout(LayoutKind.Sequential,Pack=1)]
VulpesPosted Feb 15, 2014, 3:51 PM
1. You'll need to import it using the DllImport attribute.
2. You'll need to mimic the struct, OurType, from C# code.
Here's some code. I've assumed the dll is called calltest.dll and has been copied to the C# executable's directory: