Ken H

Ken H

  • NA
  • 646
  • 360.7k

How to export unmanaged dll (for custom types)?

Feb 15 2014 10:55 AM
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)