M
Martin
Hi. I have a C++ application that can communicate with C++ DLL with
specific interface. I would like to know, if it is possible to create a
C# DLL with the same interface. The functions which the C++ DLL exposes
are these:
extern "C" _declspec(dllexport) int _stdcall f1(int a,char *b,int c,int
d);
extern "C" _declspec(dllexport) void _stdcall f2(void)
extern "C" _declspec(dllexport) int _stdcall f3(char *a,char *b,int c)
extern "C" _declspec(dllexport) int _stdcall f4(char *a,_T **b)
where the _T type is a structure:
typedef struct
{
char x;
char y[128];
void *z;
}_T;
In function f1 is the "b" parameter an application preallocated array
of chars (128 chars). So are the "a" and "b" parameters in function f3
and "a" parameter in function f4. The "b" parameter in function f4 is
dynamically allocated in DLL. Is it possible to rewrite this DLL
interface to C#? How?
specific interface. I would like to know, if it is possible to create a
C# DLL with the same interface. The functions which the C++ DLL exposes
are these:
extern "C" _declspec(dllexport) int _stdcall f1(int a,char *b,int c,int
d);
extern "C" _declspec(dllexport) void _stdcall f2(void)
extern "C" _declspec(dllexport) int _stdcall f3(char *a,char *b,int c)
extern "C" _declspec(dllexport) int _stdcall f4(char *a,_T **b)
where the _T type is a structure:
typedef struct
{
char x;
char y[128];
void *z;
}_T;
In function f1 is the "b" parameter an application preallocated array
of chars (128 chars). So are the "a" and "b" parameters in function f3
and "a" parameter in function f4. The "b" parameter in function f4 is
dynamically allocated in DLL. Is it possible to rewrite this DLL
interface to C#? How?