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. Hardware & Devices
  4. Getting a driver to work in a managed environment

Getting a driver to work in a managed environment

Scheduled Pinned Locked Moved Hardware & Devices
csharpc++questionannouncementworkspace
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.
  • M Offline
    M Offline
    MarkB777
    wrote on last edited by
    #1

    Hi all, I have a simple driver which compiles and loads fine, and a simple C++ application which can read data being output from it. What I am ultimately trying to do is get the data being spat out from the driver into a C# application (which I would prefer to use to do the GUI side of things). My plan at the moment is to create a .dll, which would have the C++ code to read from the driver, and a buffer which would be exposed to the C# application to read the data. I have not got to the point of trying this yet, but from what I have been reading online I get the impression that mixing managed and unmanaged code is a nightmare. So I have two questions: #1. Am I on the right track with this plan of mine? #2. If I am not on the right track, does anyone who has been through all of this have any tips, or good articles that can get me moving in the right direction? Thankyou, Mark.

    Mark Brock "We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen

    L 1 Reply Last reply
    0
    • M MarkB777

      Hi all, I have a simple driver which compiles and loads fine, and a simple C++ application which can read data being output from it. What I am ultimately trying to do is get the data being spat out from the driver into a C# application (which I would prefer to use to do the GUI side of things). My plan at the moment is to create a .dll, which would have the C++ code to read from the driver, and a buffer which would be exposed to the C# application to read the data. I have not got to the point of trying this yet, but from what I have been reading online I get the impression that mixing managed and unmanaged code is a nightmare. So I have two questions: #1. Am I on the right track with this plan of mine? #2. If I am not on the right track, does anyone who has been through all of this have any tips, or good articles that can get me moving in the right direction? Thankyou, Mark.

      Mark Brock "We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      1. Yes, this is probably the best way to do it. 2. The P/Invoke[^] tutorial should help in designing your DLL. See also this article[^] by Luc Pattyn[^].

      speaking as ...

      M 1 Reply Last reply
      0
      • L Lost User

        1. Yes, this is probably the best way to do it. 2. The P/Invoke[^] tutorial should help in designing your DLL. See also this article[^] by Luc Pattyn[^].

        speaking as ...

        M Offline
        M Offline
        MarkB777
        wrote on last edited by
        #3

        Great, thanks Richard ;)

        Mark Brock "We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen

        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