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#
  4. How can I compile *.lib in VC++ to dll?

How can I compile *.lib in VC++ to dll?

Scheduled Pinned Locked Moved C#
questioncsharpc++
3 Posts 3 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.
  • U Offline
    U Offline
    uumeme
    wrote on last edited by
    #1

    I want to use VC++ *.lib into C# application. I know that I must compile the lib in to a dll. How can i do that? Any method and hits to me.

    I L 2 Replies Last reply
    0
    • U uumeme

      I want to use VC++ *.lib into C# application. I know that I must compile the lib in to a dll. How can i do that? Any method and hits to me.

      I Offline
      I Offline
      if_mel_yes_else_no
      wrote on last edited by
      #2

      One way is to create a new .NET project called Class Library and copy over your VC++ code. Sometimes the "It Just Works" effect will be able to translate the code. Then when you compile it, you will have your dll which you can make other projects reference. The easier way would be to open the .lib project in VC++ 6.0 and go into Project->Settings and change the output from a static library (.lib) to a dynamic library (.dll). Compile it in VC++ 6.0 to get your .dll file, which your .NET project will be able to reference.

      1 Reply Last reply
      0
      • U uumeme

        I want to use VC++ *.lib into C# application. I know that I must compile the lib in to a dll. How can i do that? Any method and hits to me.

        L Offline
        L Offline
        Luis Alonso Ramos
        wrote on last edited by
        #3

        As the other reply says, I would link your static library (.LIB) into a regular DLL using Visual C++ 6.0. Then I would use P/Invoke to call into the unmanaged DLL from .NET. -- LuisR


        Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

        The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

        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