Click here to Skip to main content
11,432,427 members (62,136 online)
Rate this: bad
good
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 at 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.
Sergey Alexandrovich Kryukov at 2-Mar-13 0:25am
   
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 at 2-Mar-13 0:48am
   
From the whole code, I couldn't separate the port stuff from the MFC stuff.
Sergey Alexandrovich Kryukov at 2-Mar-13 1:10am
   
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 at 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)?
Sergey Alexandrovich Kryukov at 2-Mar-13 20:18pm
   
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)



Advertise | Privacy | Mobile
Web04 | 2.8.150428.2 | Last Updated 2 Mar 2013
Copyright © CodeProject, 1999-2015
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