Reading from LPT1 using MS VC++ 2008 on Windows 7(x64)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gellidus
    New Member
    • Apr 2010
    • 3

    Reading from LPT1 using MS VC++ 2008 on Windows 7(x64)

    I need to read from my LPT1 port when a connected device pulls one of the data pins high, and from all my googling and forum/maillist browsing im no closer to a solution. I have tried the inpout32.dll, tried using CreateFile() with a ReadFile(), but to no use.. there just doesn't seem to be any communication going on. As mentioned im running on Windows 7 x64 and need a solution for this OS.
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    I think you need to write a custom device driver to interface with the LPT port your device connects to.

    Have you looked at: http://www.microsoft.com/whdc/driver...n/default.mspx

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      Also, with Windows 7 you need administer privileges to get a device handle. This is a change from XP.

      CreateFile should work if you have admin privileges.

      Comment

      • Gellidus
        New Member
        • Apr 2010
        • 3

        #4
        Thanks for the replies, i will look into the custom driver.

        Comment

        • newb16
          Contributor
          • Jul 2008
          • 687

          #5
          It might take less efforts if you use some other hardware interface - arduino, bitbang-capable ftdi usb interface chip, whatever.

          Comment

          • Gellidus
            New Member
            • Apr 2010
            • 3

            #6
            I have a hard deadline on my project, and i've had zero luck making it work so for now the windows version is put on ice (sadly) but it takes too much time trying to make it work. I will reply on this post if/when I have the time to get the windows version up and running. Thanks for the replies.

            Comment

            Working...