Click here to Skip to main content
12,070,942 members (64,938 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C++
Hi, I want to build a small application that can control a bunch of led's connected to the parallel port. From what I've read over the internet, I've come to know that I have to use Inpout32.dll for accessing the port.

> I have downloaded 'Inpout32.dll' and 'inpout.lib', now how do I include it in my visual c++ project. I'm using Visual Studio 11 Ultimate and I'm making a c++ console application.

> What functions do I have to use to send data to the parallel port?

> Can someone point me to a good, lucid, clear tutorial/example other than http://www.lvr.com/parport.htm[^]
Posted 1-Mar-13 18:09pm
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Please see this CodeProject article: Hardware Interface Programming in VC++ - Part I (Port Access)[^].

—SA
  Permalink  
Comments
Harshil Sharma 2-Mar-13 0:08am
   
That is a good tutorial, but I want to do it using Inpout32.dll in a console application, no MFC.
   
What are you talking about?! Ever heard of separation of concerns? MFC is irrelevant here. Don't want it (I understand it very much), don't use it...
—SA
Harshil Sharma 2-Mar-13 0:48am
   
From the whole code, I couldn't separate the port stuff from the MFC stuff.
   
Well, sorry. I wish I've written the C++ library and demo, but I didn't :-)
However, I would advise you not to rely on something which is ready-to-use, better put some effort.
Good luck,
—SA
Harshil Sharma 2-Mar-13 7:27am
   
Alright, can you tell me how do I include the 'Inpout32.dll' in my project (visual c++ consol application, visual studio 11)?
   
Never tried that one... in a usual way, I think... :-)
—SA
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

I wrote this code:

#include "stdafx.h"
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
#include

short _stdcall Inp32(short PortAddress);
void _stdcall Out32(short PortAddress, short data);



int main(int argc, char* argv[])
{


Out32(888, 255);
system("pause");
Out32(888, 0);

return 0;
}


Is this not supposed to turn on all led's first then turn them off? Nothing happened.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web04 | 2.8.160208.1 | Last Updated 2 Mar 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100