How to call native VC++6 library (with std::string as parameters) from C#
<p>I have a native dynamic link library written in VC++6 and I do not have access to the source code. I would like to convert it to managed code so that C# can call this library. The problem is that the VC6 library heavily makes use of std::vector and std::string as function parameters and there is no way of marshaling these types into C# directly. </p>

<p>So what I need is a bridge between VC6 and C# and I implemented a VC++2005 wrapper for VC++6.</p>

<p>However, I realized from the reply (by jalf) to the following thread that "VC++6 and VC++2005 have different definitions of std::string (and the compilers may also insert different padding and other changes), and the result is garbage, and/or unpredictable behavior and crashes".</p>

<p><a href="http://stackoverflow.com/questions/1804359/passing-stdstring-from-vc2005-to-vc6-dll-results-in-garbage">Passing std::string from VC++2005 to VC++6 DLL results in garbage</a></p>

<p>So now, the big question is, <b>how can I call the VC++6 native library from C#?</b> </p>

<p>I am at a loss and any help is greatly appreciated.</p>
