Hi
I want to use the parallel port of my computer to make external electronics work. I am using Turbo C++ in Windows XP. I heard that you have to include inpout32 to make the programme work. Is just placing inpout32.dll in the sytems directory sufficient? If not, how do I call inpout32 from Turbo C++?
Yes vkixer, placing inpout32.dll in the systems directory should be fine (if you did)
You said that your machine runs on winXP, you can also download and install portTalk or UserPort in the software downloads section in this board so can have access to your parallel and serial ports
thanks
but the link shows programming in VB.
I have added the inpout32.dll to my systems directory
I want to know how to call the requred funtions of inpout32 in turbo C++.
No you don't need any file . i did without the file inpout32.dll.
you just use the functions :inp, outp . knowing the port number .
Here is the code :
#include<stdio.h>
#include<conio.h>
int main(void) {
unsigned port = 0x378 // first pin in parallel port 0x378-0x37f
int value ;
value = outp(port,'c') // c is the number you'll send to LPT
printf("value %c sent to port %d\n", value, port);
return 0 }
No you don't need any file . i did without the file inpout32.dll.
you just use the functions :inp, outp . knowing the port number .
Here is the code :
#include<stdio.h>
#include<conio.h>
int main(void) {
unsigned port = 0x378 // first pin in parallel port 0x378-0x37f
int value ;
value = outp(port,'c') // c is the number you'll send to LPT
printf("value %c sent to port %d\n", value, port);
return 0 }
Thank for reply, I can't test it now simply bcz I've to install the TC++ environment, I've used TC++ some year ago (at my college with DOS based release, I can remember usage of some library extension to code program with windows), now I'm using VC++, but what I need to know is just to be sure about pratical use of the in and out in WinXP environment.
I have tested your code. It works. But there are some problems. I want your help to solve these problems.
For any value, I am turining on Seven segment LED. I am getting correct results bt it is displayed after completion of program and mostly I need to run the program twice.
Other problem I am facing is I have made soft counnter using your hint bt it is not working.
Can you send me the solution?? I will be very thankful to you.
I also request you to send your personal email id so that I can send you d code for second problem.