S
SB
What is the proper way to pass a character array (char *) from a "C" dll to
a C# method (delegate) in my app? Getting the dll (which simulates a third
party dll) to call my delegate works fine. However, as soon as I try to add
any "char *" parameters, I start getting exceptions in my C# app.
So far I've tried (among others):
public delegate int Test(char[] version);
and
public delegate int Test(string version); // won't work because string is a
managed type I suppose
I've read many articles on sending data from C# to a C dll...but not much is
written about going the other way around. In short, I'm basically sending
the C dll a callback address...and the C dll is supposed to fire the
callback and pass back a char array....then my app needs to convert it to a
string to work with.
TIA!
sb
a C# method (delegate) in my app? Getting the dll (which simulates a third
party dll) to call my delegate works fine. However, as soon as I try to add
any "char *" parameters, I start getting exceptions in my C# app.
So far I've tried (among others):
public delegate int Test(char[] version);
and
public delegate int Test(string version); // won't work because string is a
managed type I suppose
I've read many articles on sending data from C# to a C dll...but not much is
written about going the other way around. In short, I'm basically sending
the C dll a callback address...and the C dll is supposed to fire the
callback and pass back a char array....then my app needs to convert it to a
string to work with.
TIA!
sb