program needed to control output on lpt1 port

This is a discussion on program needed to control output on lpt1 port within the C++ Programming forums, part of the General Programming Boards category; Hi I have a small project and at the moment have no idea how to write a .exe file, but ...

  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    2

    program needed to control output on lpt1 port

    Hi I have a small project and at the moment have no idea how to write a .exe file, but I learn fast.

    I need to write a program to latch a bit on the parallel port LPT1 to control a relay board.

    Say on2.exe to turn on bit 2 on the LPT1 port.
    Say on4.exe to turn on bit 4 on the LPT1 port.
    Say off.exe to reset output pins on LPT1 port.

    Help in this direction or code I can compile, and what software I need.

    Working in Windows XP SP2.

    THANKS IN ADVANCE.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,674
    First you make sure you're using a compiler which is actually compatible with your OS (say visual studio), as opposed to some 20 year old DOS compiler (which just happens to run through a mass of "compatibility" layers).

    That said, start here
    CreateFile Function (Windows)
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Jul 2010
    Posts
    2
    Should have Visual studio 2008 by the end of the day.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 02-29-2008, 12:29 PM
  2. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  3. GPL license: how does it cover the output of a program?
    By psychopath in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 05-25-2006, 01:37 AM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  5. Help needed: Output to Parallel port.
    By Ingsy in forum C Programming
    Replies: 4
    Last Post: 10-10-2001, 12:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21