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. .NET (Core and Framework)
  4. Accessing "Native" DLL from a .NET App

Accessing "Native" DLL from a .NET App

Scheduled Pinned Locked Moved .NET (Core and Framework)
c++csharpcomquestion
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.
  • B Offline
    B Offline
    bneacetp
    wrote on last edited by
    #1

    Let's say that I develop the innerworkings of a program in a Win32 DLL (in Native C++) and I want the GUI for the application to take advantage of .NET. How would I work the connection between the two without resorting to turning the native C++ to Managed C++? :confused: In other words, I would like to have the .NET application to be able to access and make use of the Win32 DLL. Happy Programming and may God bless! "Your coding practices might be buggy, but your code is always right." Internet::WWW::CodeProject::bneacetp N-Tech Productions http://www.n-tp.com/

    Z 1 Reply Last reply
    0
    • B bneacetp

      Let's say that I develop the innerworkings of a program in a Win32 DLL (in Native C++) and I want the GUI for the application to take advantage of .NET. How would I work the connection between the two without resorting to turning the native C++ to Managed C++? :confused: In other words, I would like to have the .NET application to be able to access and make use of the Win32 DLL. Happy Programming and may God bless! "Your coding practices might be buggy, but your code is always right." Internet::WWW::CodeProject::bneacetp N-Tech Productions http://www.n-tp.com/

      Z Offline
      Z Offline
      zagzagzag
      wrote on last edited by
      #2

      First thing: using System.Runtime.InteropServices; along with your other using statements in the beginning of the c file.. then create a class: public class DllWrap { [DllImport(string DllName) public static extern int/bool/string/... FunctionName(function calls); } when you have to call the function from the code: DllWrap.FunctionName(calls needed); Hope it works for you... Regards..

      B 1 Reply Last reply
      0
      • Z zagzagzag

        First thing: using System.Runtime.InteropServices; along with your other using statements in the beginning of the c file.. then create a class: public class DllWrap { [DllImport(string DllName) public static extern int/bool/string/... FunctionName(function calls); } when you have to call the function from the code: DllWrap.FunctionName(calls needed); Hope it works for you... Regards..

        B Offline
        B Offline
        bneacetp
        wrote on last edited by
        #3

        Thanks for your response! :-D Happy Programming and may God bless! "Your coding practices might be buggy, but your code is always right." Internet::WWW::CodeProject::bneacetp N-Tech Productions http://www.n-tp.com/

        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