N
news.broadpark.no
I have a problem interfacing a DLL written in Ada. In C++ I do as follows:
typedef void(*pfGetItems)( char** ppsc, int num );
.....
pfGetItems GetItems = (pfGetItems)::GetProcAddress(hModule, "GetItems");
next I create the char array:
char** pszBuf=new char*[num];
for (int i=0; i<num; i++)
pszBuf=new char[100];
next I call the function and the result is stored in pszBuf. I have trouble
doing this in C#. I have tried the following:
[DllImport(@"Te.dll")]
private static extern void GetItems(ref StringBuilder[]Items, int num);
But, I can't make it work. Any tips on how to do this?
Best regards,
Eirik
typedef void(*pfGetItems)( char** ppsc, int num );
.....
pfGetItems GetItems = (pfGetItems)::GetProcAddress(hModule, "GetItems");
next I create the char array:
char** pszBuf=new char*[num];
for (int i=0; i<num; i++)
pszBuf=new char[100];
next I call the function and the result is stored in pszBuf. I have trouble
doing this in C#. I have tried the following:
[DllImport(@"Te.dll")]
private static extern void GetItems(ref StringBuilder[]Items, int num);
But, I can't make it work. Any tips on how to do this?
Best regards,
Eirik