如何从C ++设置和读取并行端口上的引脚? [英] How to set and read pins on the parallel port from C++?

查看:78
本文介绍了如何从C ++设置和读取并行端口上的引脚?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在帮助一个朋友完成最后一个项目,在这个项目中他拥有我们想要使用C ++程序打开和关闭的电路。

I am helping a friend to finish a final year project in which he has this circuit that we want to switch on and off using a C++ program.

我最初以为这很容易,但是我没有实现这个程序。
主要问题是

I initially thought it would be easy, but I have failed to implement this program. The main problem is that


  • Windows XP和更高版本不允许直接访问硬件,因此一些网站建议我需要编写驱动程序或查找驱动程序。

  • 我也在线查看了一些项目,但它们似乎适用于Windows XP,但不适用于Windows 7。

  • 此外,大多数项目都是用VB或C#编写的,我

  • Windows XP and above don't allow direct access to hardware so some websites are suggesting that I need to write a driver or find a driver.
  • I have also looked at some projects online but they seem to work for Windows XP but fail to work for Windows 7.
  • Also, most projects were written in VB or C# which I am not familiar with.

问题:


  • 是否有适合Windows XP和Windows 7的驱动程序,如果可以,如何在代码中使用它? (代码片段将不胜感激)

  • 是否存在处理与并行端口通信的跨平台方式?

推荐答案

看看代码项目:这里此处此处。您会发现宝藏。

Have a look at codeproject: here, here and here. You'll find treasures.

第一个链接适用于Windows 7-32位和64位。

The 1st link works for Windows 7 - both 32 bit and 64 bit.

这篇关于如何从C ++设置和读取并行端口上的引脚?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆