Re: Parallel Port access with XP
Mark Walker wrote:
Hi,
Thanks for the link.
I've tried 99% of the drivers / apps / utils etc on that page and so far ive
had no luck.
Could someone tell me - is parallel port access actually a hard thing to do?
(considering im new to VC++) Going from 'C' i thought i would be able to self
teach VC++ fairly easily but im struggling quite badly!
I copy code after code word for word but it doesnt often compile, no matter
which driver or .sys file i am trying to use. Or if i find a driver that does
compile, then trying to activate the 'port write' will always crash my
program.
Hmmm... guess i should really try to walk before i run huh?
The hardest thing i am finding is how to port the source code examples into
my code.
I am using the 'New Project wizard' that VC++ 2005 EE gives... so by default
i start with several created files including form1.h, 'program name'.cpp,
stdafx (i think).h etc. There's about half a dozen of them.
I'm never sure where to insert the 'driver related' code. Everything i have
added so far has been in Form1.h, in the form of event handlers.
So confused!
Yes, parallel port access is a hard thing to do because the operating
system prevents application programs from directly accessing hardware
resources. So you have to install a driver and call it to do the I/O
for you.
The fact that you get a "form1" makes me think you are creating a
"managed" new project, which brings in a whole lot of libraries and
rules that a 'C' programmer doesn't need. Try building a rather
straightforward "Win 32, Win32 Project" instead of the fancy stuff.
And, be aware that with EE you also need the Platform SDK from Microsoft
(a free download). The Express Edition does not include the necessary
..h and .lib files for making direct Windows API calls.
--
Scott McPhillips [VC++ MVP]