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. Visual Basic
  4. Parallel Port Communication Problem

Parallel Port Communication Problem

Scheduled Pinned Locked Moved Visual Basic
csharpvisual-studiohelpcss
5 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.
  • R Offline
    R Offline
    Ritesh Sompura
    wrote on last edited by
    #1

    Hi! Guys, I am working with VB.NET 2002 on Windows XP. I have a problem while working with parallel port. I have downloaded the dlls needed to communicate with parallel port on Windows XP. But, the program doesn't seems to be working. Isn't there any way to communicate with Parallel Port in Visual Studio.NET 2002 itself? I am really feeling help-less while hardware interfacing comes in my way while working with VS.NET. If you guys know anything please let me know. I am open for comments and suggestions. Thanking you, Ritesh.

    D J 2 Replies Last reply
    0
    • R Ritesh Sompura

      Hi! Guys, I am working with VB.NET 2002 on Windows XP. I have a problem while working with parallel port. I have downloaded the dlls needed to communicate with parallel port on Windows XP. But, the program doesn't seems to be working. Isn't there any way to communicate with Parallel Port in Visual Studio.NET 2002 itself? I am really feeling help-less while hardware interfacing comes in my way while working with VS.NET. If you guys know anything please let me know. I am open for comments and suggestions. Thanking you, Ritesh.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      There is nothing native to .NET. This is because all hardware, including the par/ser ports, is abstracted by the operating system and the processor running in protected mode. You absolutely must have those helper .DLL's to give you the ability to control the port directly. You might want to look at these: http://www.codeproject.com/csharp/csppleds.asp[^] http://www.logix4u.net/[^] RageInTheMachine9532

      1 Reply Last reply
      0
      • R Ritesh Sompura

        Hi! Guys, I am working with VB.NET 2002 on Windows XP. I have a problem while working with parallel port. I have downloaded the dlls needed to communicate with parallel port on Windows XP. But, the program doesn't seems to be working. Isn't there any way to communicate with Parallel Port in Visual Studio.NET 2002 itself? I am really feeling help-less while hardware interfacing comes in my way while working with VS.NET. If you guys know anything please let me know. I am open for comments and suggestions. Thanking you, Ritesh.

        J Offline
        J Offline
        jfk_lili
        wrote on last edited by
        #3

        u hv the full admin right to ur NT system? if u dont hv the full admin right although u get all the DLL in sys directory, it's still helpless. u must hv the full admin right to ur NT system, otherwise u need to find a crack program to crack it. But it's quite hard to find such one

        D 1 Reply Last reply
        0
        • J jfk_lili

          u hv the full admin right to ur NT system? if u dont hv the full admin right although u get all the DLL in sys directory, it's still helpless. u must hv the full admin right to ur NT system, otherwise u need to find a crack program to crack it. But it's quite hard to find such one

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Actually, the User's rights have nothing to do with the problem. You can be a normal (member of) User and have no issues with it at all. The problem is the the INP and OUT instructions can only run in processor Ring0 (Kernel mode). Users programs are restricted to running in Ring3 (User mode). This means that if you try and execute and INP or OUT I/O port instruction, you'll get the infamous Application Exception Error saying something about executing a Priviledged Instruction. The user's rights to the system have nothing to do with this. To get around the problem, you need a kernel mode (Ring0) device driver that can talk to the parallel port, and read and write data to it, and exposes some form of API that a user mode (Ring3) application can talk to. The kernel mode driver contains the INP and OUT instructions that are allowed to run in Ring0, but not Ring3. Now, for a good example of how this is accomplished, see this site: http://www.logix4u.net/[^] RageInTheMachine9532

          R 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Actually, the User's rights have nothing to do with the problem. You can be a normal (member of) User and have no issues with it at all. The problem is the the INP and OUT instructions can only run in processor Ring0 (Kernel mode). Users programs are restricted to running in Ring3 (User mode). This means that if you try and execute and INP or OUT I/O port instruction, you'll get the infamous Application Exception Error saying something about executing a Priviledged Instruction. The user's rights to the system have nothing to do with this. To get around the problem, you need a kernel mode (Ring0) device driver that can talk to the parallel port, and read and write data to it, and exposes some form of API that a user mode (Ring3) application can talk to. The kernel mode driver contains the INP and OUT instructions that are allowed to run in Ring0, but not Ring3. Now, for a good example of how this is accomplished, see this site: http://www.logix4u.net/[^] RageInTheMachine9532

            R Offline
            R Offline
            Ritesh Sompura
            wrote on last edited by
            #5

            Hi! Folks,:) Below are the few queries that have arised in my mind after looking at the code in file "inpout32drv.cpp". These are few of the hardcoded paths, that I have found, 1. C:\kernel_mode_driver_source\i386\hwinterface.pdb 2. nsf.\i386\hwinterface.sys 3. In CreateService function call you are using the hardcoded path "System32\\Drivers\\hwinterface.sys", but I have the "hwinterface.sys" file in the application directory only. Also, I have no such file in my "system32\drivers" directory. First of all I don't know these paths stands for what? Second thing is, Any of the above specified paths are not valid on my system. Can these be a reason, that program is not working on my system? I am sending the same at your e-mail box. Thanking You, Regards, Ritesh.

            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