Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. Using VC6 MFC DLLs in VS2008

Using VC6 MFC DLLs in VS2008

Scheduled Pinned Locked Moved Managed C++/CLI
c++
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Radhakrishnan G
    wrote on last edited by
    #1

    I am using an old dll which is written in VC6 MFC( Builded with mfc42u.lib), I need to reuse the same in my C++/CLI application which is in VS2008( it use mf90u.lib) while copying a string buufer to that old dll it cause an exception like "try to read/writing in protected meory"

    // Class in old dll
    String^ csMyString = gcnew String( "some value" );
    MyClass* fromOldDll = new MyClass();
    fromOldDll->m_csSomeString = static_cast(Marshal::StringToHGlobalUni(csMyString).ToPointer());
    // Above line cause exception

    Is any other idea for implementing the same, it is not possible to modify the old dll Thanks Radhakrishnan G.

    N 1 Reply Last reply
    0
    • R Radhakrishnan G

      I am using an old dll which is written in VC6 MFC( Builded with mfc42u.lib), I need to reuse the same in my C++/CLI application which is in VS2008( it use mf90u.lib) while copying a string buufer to that old dll it cause an exception like "try to read/writing in protected meory"

      // Class in old dll
      String^ csMyString = gcnew String( "some value" );
      MyClass* fromOldDll = new MyClass();
      fromOldDll->m_csSomeString = static_cast(Marshal::StringToHGlobalUni(csMyString).ToPointer());
      // Above line cause exception

      Is any other idea for implementing the same, it is not possible to modify the old dll Thanks Radhakrishnan G.

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      Unfortunately, you cannot always mix DLLs like that. One solution would be to recompile the old DLL using VC 2008.

      Regards, Nish


      My technology blog: voidnish.wordpress.com Code Project Forums : New Posts Monitor This application monitors for new posts in the Code Project forums.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups