4
Answers

How to export unmanaged dll (for custom types)?

Ken H

Ken H

10y
1.3k
1
hello,
 
   My code is this:
#include<iostream>
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 a
ot.y=b; // Assumed to be b
return ts;
}
}
 
In addition, What types can accept its(OurType)in c#? 
 
Thanks. 
 
Answers (4)
Next Recommended Forum