开发者

How to check if button is pressed and working on LPT port in C++

I have a button I got out of a rand开发者_如何转开发om item around the house and I wanna hook it up to my LPT port and check if its pressed or not in C++ and if it is display a message.


Your best bet is to use the inpout32.dll which will enable you to read/write from/to the LPT port. The usage of direct addressing of hardware ports is restricted, the dll will enable you to get around the restriction as it executes an internal driver which is already built into the dll and therefore communicating with the driver in an indirect fashion. The dll can be downloaded from here, there is one available for x64bit platform here.

Hope this helps, Best regards, Tom.


If you want to learn about accessing the parallel port, here is a good resource: Lakeview Research

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜