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

查看:32
本文介绍了如何从 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 的驱动程序,如果有,我如何在我的代码中使用它?(代码片段将不胜感激)
  • 是否有一种跨平台的方式来处理与并行端口的通信?

推荐答案

看看codeproject:这里这里这里.你会找到宝藏的.

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天全站免登陆