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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Using .Net DLL in VC6

Using .Net DLL in VC6

Scheduled Pinned Locked Moved C / C++ / MFC
comhelpcsharpcss
3 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.
  • Z Offline
    Z Offline
    ZawMinTun
    wrote on last edited by
    #1

    Hello everyone, Now I'm facing some problems trying to use .Net 4.0 DLLs in VC6. Just to share some background info, it started with a requirement I need to use a (.Net 4.0 third-party) grid in an old VC6 application. I browsed the internet and got the information about the interop and COM and so on. Finally I arrived to this point: I used Microsoft's Interop Form Library in VS-2010 and created a dll file wrapping the third-party grid. Then from VB6 I tried to use it in VB6. It's working. I tried to do the same in VC6, but failed, and I also don't know exactly how to do exactly the same as in VB6. So I created VB6 ActiveX Control wrapping this dll. I used this ActiveX Control in VB6 exe applicaiton. It's working too. Then I tried to use the ActiveX control from VC6. I can load the grid on to the UI (by clicking a button). However, the intrinsic functions of the third-party grid (such as sorting by double-click on the column-header, group by the colums drag and drop) are not working anymore. Even when I click on the grid, the application hangs up. The error is saying something related with ".Net-BroadcastEventWindow". Can you please help me? Any information or guess-and-advise will be useful and really thankful. Best regards, Zaw Min Tun

    D 1 Reply Last reply
    0
    • Z ZawMinTun

      Hello everyone, Now I'm facing some problems trying to use .Net 4.0 DLLs in VC6. Just to share some background info, it started with a requirement I need to use a (.Net 4.0 third-party) grid in an old VC6 application. I browsed the internet and got the information about the interop and COM and so on. Finally I arrived to this point: I used Microsoft's Interop Form Library in VS-2010 and created a dll file wrapping the third-party grid. Then from VB6 I tried to use it in VB6. It's working. I tried to do the same in VC6, but failed, and I also don't know exactly how to do exactly the same as in VB6. So I created VB6 ActiveX Control wrapping this dll. I used this ActiveX Control in VB6 exe applicaiton. It's working too. Then I tried to use the ActiveX control from VC6. I can load the grid on to the UI (by clicking a button). However, the intrinsic functions of the third-party grid (such as sorting by double-click on the column-header, group by the colums drag and drop) are not working anymore. Even when I click on the grid, the application hangs up. The error is saying something related with ".Net-BroadcastEventWindow". Can you please help me? Any information or guess-and-advise will be useful and really thankful. Best regards, Zaw Min Tun

      D Offline
      D Offline
      David Knechtges
      wrote on last edited by
      #2

      If you can recompile the old VC6 code using VS2010 and its compiler, then you will have an easier time. In this case, you can then change it to a C++/CLI project and then use any .NET controls you wish. Basically, just open the old VC6 project in VS2010 and recompile. If that works, then change the project over to C++/CLI and you are in business. If you cannot recompile the VC6 project, but can directly load DLLs, then you could use C++/CLI to be a wrapper DLL around the .NET stuff and call it from the old C style code. Using COM and Interop the way you did is not easy as you found out. That is why you might consider the 2 suggestions above.

      Z 1 Reply Last reply
      0
      • D David Knechtges

        If you can recompile the old VC6 code using VS2010 and its compiler, then you will have an easier time. In this case, you can then change it to a C++/CLI project and then use any .NET controls you wish. Basically, just open the old VC6 project in VS2010 and recompile. If that works, then change the project over to C++/CLI and you are in business. If you cannot recompile the VC6 project, but can directly load DLLs, then you could use C++/CLI to be a wrapper DLL around the .NET stuff and call it from the old C style code. Using COM and Interop the way you did is not easy as you found out. That is why you might consider the 2 suggestions above.

        Z Offline
        Z Offline
        ZawMinTun
        wrote on last edited by
        #3

        Thanks a lot, David. The first option is probably a bit discouraging (for the source files are quite a lot and a bit messy already through the ages), so I'll be trying the second. In fact, I've already tried wrapping in C# and calling from VC++, but still in vain. So I will try this in C++/CLI. For your advice and time, thanks a lot. Best regards, Zaw Min Tun

        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