How to set and read pins on the parallel port from C++?(如何从 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++ 设置和读取并行端口上的引脚?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何从 C++ 设置和读取并行端口上的引脚?


基础教程推荐
- 如何使图像调整大小以在 Qt 中缩放? 2021-01-01
- 为什么语句不能出现在命名空间范围内? 2021-01-01
- 如何“在 Finder 中显示"或“在资源管理器中显 2021-01-01
- 管理共享内存应该分配多少内存?(助推) 2022-12-07
- 使用从字符串中提取的参数调用函数 2022-01-01
- 从 std::cin 读取密码 2021-01-01
- 在 C++ 中循环遍历所有 Lua 全局变量 2021-01-01
- Windows Media Foundation 录制音频 2021-01-01
- 为 C/C++ 中的项目的 makefile 生成依赖项 2022-01-01
- 如何在不破坏 vtbl 的情况下做相当于 memset(this, ...) 的操作? 2022-01-01