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. C / C++ / MFC
  4. why VC++ 6.0 DLL works with VC# and the one in Visual Studio 2005 doesnt?

why VC++ 6.0 DLL works with VC# and the one in Visual Studio 2005 doesnt?

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++htmlvisual-studiocom
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.
  • S Offline
    S Offline
    saania khan
    wrote on last edited by
    #1

    One of the things that I have been working on for the past couple of days is creating a DLL in VC++ 6.0 and using it in VC#, and it works..... but when I create the dll in VC++ Visual Studio 2005, it doesnt work with the VC# code.(in Visual Studio 2005)...... I get the error message that it could not find the fntest () function in TestDll.dll. Let me be more specific about how I created the DLL.....( and I followed the same steps for VC++ 6.0 and VC++ 2005). After following the steps in the link http://www.icynorth.com/development/createdlltutorial.html(I created a project that exports some symbols instead of a simple dll)I created a .def file, specified the test function as EXPORT. Then I went to build->configuration manager. and changed the configuration from debug to release. I then built the project, got the dll and copied it to the folder C:\WINDOWS\system32. Then I used PInvoke in VC# code and it worked fine for a VC++ 6.0 dll but not for a Visual Studio 2005 dll in VC++. I have a code ( written by someone else) in Visual Studio 2005. It has a lot of libs etc. specific to .NET, so I have to convert this code to a dll and then use it in my VC# program. I am desperately waiting for a response. Thanks,

    C 1 Reply Last reply
    0
    • S saania khan

      One of the things that I have been working on for the past couple of days is creating a DLL in VC++ 6.0 and using it in VC#, and it works..... but when I create the dll in VC++ Visual Studio 2005, it doesnt work with the VC# code.(in Visual Studio 2005)...... I get the error message that it could not find the fntest () function in TestDll.dll. Let me be more specific about how I created the DLL.....( and I followed the same steps for VC++ 6.0 and VC++ 2005). After following the steps in the link http://www.icynorth.com/development/createdlltutorial.html(I created a project that exports some symbols instead of a simple dll)I created a .def file, specified the test function as EXPORT. Then I went to build->configuration manager. and changed the configuration from debug to release. I then built the project, got the dll and copied it to the folder C:\WINDOWS\system32. Then I used PInvoke in VC# code and it worked fine for a VC++ 6.0 dll but not for a Visual Studio 2005 dll in VC++. I have a code ( written by someone else) in Visual Studio 2005. It has a lot of libs etc. specific to .NET, so I have to convert this code to a dll and then use it in my VC# program. I am desperately waiting for a response. Thanks,

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      If you update your VC6 project to 2005, does it still work ?

      saania khan wrote:

      I have a code ( written by someone else) in Visual Studio 2005. It has a lot of libs etc. specific to .NET, so I have to convert this code to a dll and then use it in my VC# program.

      If it's specific to .NET then it's managed code, which means you should be building a managed dll ( in fact, you have to ) and you won't p/invoke that, you'll just import it.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

      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