title: How to set and read pins on the parallel port from C++?
body: <p>I am helping a friend to finish a final year project in which he has this circuit that we want to switch on and off using a C++ program.  </p>
  
  <p><img src="https://i.stack.imgur.com/IVyNI.jpg" alt="image of what i want"></p>
  
  <p>I initially thought it would be easy, but I have failed to implement this program. 
  The main problem is that </p>
  
  <ul>
  <li>Windows XP and above don't allow direct access to hardware so <a href="http://www.beyondlogic.org/porttalk/porttalk.htm" rel="nofollow noreferrer">some websites</a> are suggesting that I need to write a driver or find a driver.</li>
  <li>I have also looked at some projects online but they seem to work for Windows XP but fail to work for Windows 7.</li>
  <li>Also, most projects were written in VB or C# which I am not familiar with.</li>
  </ul>
  
  <p><strong>Question:</strong></p>
  
  <ul>
  <li>Is there a suitable driver that works for Windows XP and Windows 7, and if yes how can I use it in my code? (code snippets would be appreciated)</li>
  <li>Is there a cross platform way of dealing communicating with parallel ports?</li>
  </ul>