Linking Visualc++ 6 dll with c++ .net

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • stephane jaeger

    Linking Visualc++ 6 dll with c++ .net

    Hi,
    I am currently having trouble with the following code sample:

    #include "stdafx.h"
    #include <iostream>
    #include "DLL6.h"

    void helloWorld(cons t std::string& pValue)
    {
    std::cout << pValue.c_str() << std::endl;
    }

    This is compiled using visual C++ v6.0 in a dll (Use of Multithreaded
    runtime Dll - exceptions disabled - rtti enabled )

    Then, I create the following executable with visual .net:

    #include "stdafx.h"
    #include "Dll6.h"

    int main(int argc, char* argv[])
    {
    helloWorld(std: :string("Hello world"));
    return 0;
    }
    The program compiles and links properly but crashes in std::string

    I've read in the msdn that the standard library has changed from VC6 to
    VC7 .net. And I 've read compatibility issues stuff about STL and also
    about the default runtime library.
    So I ve tried to change the settings of the VC6 compiled dll in many
    ways (enabling exceptions, /Nodefault ). I have also tried to change the
    settings of the .net compiled main (forcing the use of old default
    libraries msvcirt.lib ). Nothing worked.
    I 'am stucked ..... :o(
    If anybody has some tips.....
    Thank you in advance,
    Bye
    Stephane

Working...