Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
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

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

—SA
 
Share this answer
 
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.
Sergey Alexandrovich Kryukov 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 2-Mar-13 0:48am    
From the whole code, I couldn't separate the port stuff from the MFC stuff.
Sergey Alexandrovich Kryukov 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 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)?
I wrote this code:

#include "stdafx.h"
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
#include <conio.h>

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.
 
Share this answer
 
Comments
KarstenK 18-Aug-17 3:35am    
must link the inpout32.lib to your project.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900