Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

inpout32.dll??

Status
Not open for further replies.
hey thanks guys for all the help..
when i use visual basic, the para port works fine, but does not work in c or c++.. i guess there is a seperate code in c/c++ required to get access to the parallel port.. someone has any idea abt it?
thnx..
 
What compiler are you using. You need a DOS compiler like Turbo C for outportb to work.
But that isn't recommended if you're running Windows.
 
yes thanks I also came accross that link.. It gave me a c++ code to access parallel port.

But that code does not work in my Turbo c++ compiler.. it has #include<windows.h>
which shows error..

now what code should I write in Turbo c/c++ that can help me access the parallel port through "inpout.dll"??

pls help..
 
yes thanks I also came accross that link.. It gave me a c++ code to access parallel port.

But that code does not work in my Turbo c++ compiler.. it has #include<windows.h>
which shows error..

now what code should I write in Turbo c/c++ that can help me access the parallel port through "inpout.dll"??

pls help..
 
Hi,

With respect to Win XP...

Back when i was writing a serial interface app for reading the serial port,
i used DOS and read the serial port just fine. I believe this classifies it
as a "console app" rather than a "windows app". The code was in
assembler.
When i went to use it as a windows app, it would not read the port but
would give an error as to a program trying to directly access to the port
(or something like that). I was forced to switch to using the Windows
API to access the port from Windows. It worked, but i preferred using
the DOS assembler technique. It's too bad Windows XP screwed that
all up.
The difference then was in the sub system used, DOS or Windows.
 
Last edited:
Colin, direct port access works in turbo C, Borland C++ etc but only for dos and Windows up to and including Win98. For XP they disabled direct port access and you need the driver.
 
Colin, direct port access works in turbo C, Borland C++ etc but only for dos and Windows up to and including Win98. For XP they disabled direct port access and you need the driver.

I know. Look at the Userport link I gave. After that is installed, the Turbo C program should work.
 
Last edited:
Your DOS compiler doesn't know anything about windows.h.

See if this works in Turbo C
Code:
#include <dos.h>

#define PORT 0x378

int main()
{
   outportb(PORT, 0x55);
   return 0;
}

Download Neil Fraser: Software: Parallel port monitors
Leave this program open before you run the code to see if the state of the pins change after you run the program. If it doesn't work, install Userport and try again.
The official UserPort homepage

Hey thanks Mr Colin! I installed user port and then the Turbo C code is working fine.. user port is a nice thing..
thanks..
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top