How to pass a const unsigned char * from c++ to c#
- by tzup
So I have a function in unmanaged c++ that gets called when some text happens to have "arrived":
#using <MyParser.dll>
...
void dump_body(const unsigned char *Body, int BodyLen)
{
// Need to pass the body to DumpBody, but as what type?
...
lMyParser::Parser::DumpBody(???);
}
DumpBody is a function defined in a C# DLL that should take one parameter of type?
Body holds an array of characters (text) of length BodyLen.
There's obviously some marshalling to be done here but I have no idea how.
Please help.