What is the right way to implement the win32 equivalent of the OUT opcode in dos to control the parallel port?
Posted on 2000-12-24 15:17:00 by Thomas
Under windows, OUT is "outlawed." All programs are supposed to call APIs, which communicate with device drivers, which in turn use the OUT opcode to communicate with the specific resource. With the parallel port, you have to use CreateFile and WriteFile and a few other APIs. There's a whole topic on communications in the Win32 Programmer's Reference help file.
Posted on 2000-12-24 21:31:00 by Hel
That's only partially true. Windows 9x (and me too I suppose) don't care nor check what you do with the IO ports. OUT and IN are quite fine and do their job without any VxD. If you go to NT, only then will you need a WDM style driver.
Posted on 2000-12-24 23:49:00 by Ernie
I want to fully control the parallel port, i.e. setting the data & control bits, like you would use OUT (baseport+X), byte. Is this possible with the windows API?? AFAIK, the API controls the control bits and strobe bit etc. I can use OUT and IN with windows 9x, but my program should run both on 9x and NT and I would prefer using the windows API.
Posted on 2000-12-25 04:59:00 by Thomas
There is a dll that has been written to allow you to do this : http://www.internals.com has it (its called WinIO) - works 9x.2k.NT etc I found it literally by mistake when wandering/surfing (as I do for most things) and d/l it. It is supposed to do exactly what you want (which is why I d/l it) but every attempt I made to use it fell over with errors - if you get it working (i need to use 378h & 378h+2 with the old OUT command too for my project) pls let me know!! He doesn't have .asm examples but reckons they're around (I emailed him RE my prob) James http://james.ezylink.net.au
Posted on 2000-12-25 07:25:00 by James
ernie... ther is some things you can't do in win9x with the io ports... such as diskwrites and a few others... just thought i should mention that...
Posted on 2000-12-25 10:11:00 by NervGaz
Try this resource: http://www.lvr.com/parport.htm
Posted on 2000-12-25 10:41:00 by Ernie
Thanks for all the answers, I decided to use the WinIO library and have created an include file for it and rebuilt a new .lib file because the one generated by Visual C didn't work with masm. It works fine for me now, you can download the new library and include file at http://www.exagone.f2s.com/tempdata/AsmIO.zip Just copy WinIO.dll and WinIO.sys into the same dir as your program and then use the .lib and .inc from the AsmIO.zip. (James: I guess this will solve your problem) Thomas exagone.cjb.net
Posted on 2000-12-25 18:49:00 by Thomas