Home All Groups Group Topic Archive Search About

Best way to pass string from Win32 to DotNet

Author
11 Feb 2007 4:47 AM
hB
Hello all,

What is the Best way to pass string (char*) from (Win32DLL) C/C++ to
(DotNet)C#?

Say if we allocate strings in win32 c++ dll in the heap (using new /
sysalloc - without using ATL/MFC bstr functions) Then how to
efficiently pass and consume them in the Dot Net environment C# and
VB.Net using the Dotnet String.
Also how to effectively deallocate that memory we use in between.

Kindly advise.

-Habib

AddThis Social Bookmark Button