N
nachiketamishra
Hi,
I have a to pass a char* from C# to a library in C++. I have tried
passing string and doing [MarshaAs(UnmanagedType.LPStr)]string myVal
and it didn't work . I also tried to pass an unsafe call by declaring
my method as unsafe and passing a pointer and it still doesn't work.
Any help will be appreciated.
Regards,
Nach
Code:
[DllImport(StreamLibPath)]
unsafe static extern uint writeStream(int handle, char* pBuf, uint
size, uint actualWrittenSize);
unsafe public void callStream()
{
char* data
writeStream(_myHandle, data, writeSize, writtenSize));
}
I have a to pass a char* from C# to a library in C++. I have tried
passing string and doing [MarshaAs(UnmanagedType.LPStr)]string myVal
and it didn't work . I also tried to pass an unsafe call by declaring
my method as unsafe and passing a pointer and it still doesn't work.
Any help will be appreciated.
Regards,
Nach
Code:
[DllImport(StreamLibPath)]
unsafe static extern uint writeStream(int handle, char* pBuf, uint
size, uint actualWrittenSize);
unsafe public void callStream()
{
char* data
writeStream(_myHandle, data, writeSize, writtenSize));
}