简体   繁体   English

在Windows XP上使用Qt4和C ++的并行端口输出

[英]Parallel Port Output On Windows XP using Qt4 and C++

I have a hardware device which is controlled via a parallel port connection to a PC running Windows XP. 我有一个通过并行端口连接到运行Windows XP的PC的硬件设备。 I am coding in Qt4 and C++ (Qt Creator) and need a way to output to the device over the parallel port. 我正在Qt4和C ++(Qt Creator)中进行编码,需要一种通过并行端口输出到设备的方法。 All information I have found so far references companies and websites that closed down 5 or so years ago. 到目前为止,我发现的所有信息都是5年前关闭的公司和网站。

Does anyone have any suggestions or example code on how I can accomplish this? 是否有人对我如何完成此工作有任何建议或示例代码?

Take a look at inpout32.dll . 看一下inpout32.dll

I've used this DLL in several different API's (from old Borland's OWL, VCL and even dirty MFC). 我已经在几个不同的API中使用了这个DLL(来自旧的Borland的OWL,VCL甚至是肮脏的MFC)。 To use it with Qt is quite simple. 与Qt一起使用非常简单。 Even more if you don't need input events, but just output data. 如果您不需要输入事件,而只需输出数据,则更多。

Follow the given example and let me know if you have any trouble. 请按照给定的示例进行操作,如果有任何麻烦,请告诉我。 The main points of interest are the _inp() and _outp() functions. 主要的兴趣点是_inp()_outp()函数。

Read more here and a lot of information can also be found here . 阅读更多这里和大量的信息,也可以找到这里

  • Remember that this is not portable! 请记住,这不是便携式的! this solution might be encapsulated in classes to allow OS decoupling if you need to port it to a non-windows app. 如果您需要将该解决方案移植到非Windows应用程序中,则可以将其封装在类中以允许OS解耦。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM