使用inpout32.dll进行Visual c + +并行端口访问 [英] Visual c++ parallel port acces with inpout32.dll
问题描述
我想构建一个小应用程序,它可以控制连接到并行端口的一堆led'。从我通过互联网阅读的内容来看,我已经知道我必须使用Inpout32.dll访问该端口。
>我已经下载了''Inpout32.dll''和''inpout.lib'',现在我如何将它包含在我的visual c ++项目中。我正在使用Visual Studio 11 Ultimate,我正在制作一个c ++控制台应用程序。
>我必须使用哪些功能将数据发送到并行端口?
>除了 http://www.lvr.com/parport.htm <之外,有人能指出一个好的,清晰的,清晰的教程/示例吗? / a> [ ^ ]
Hi, I want to build a small application that can control a bunch of led''s connected to the parallel port. From what I''ve read over the internet, I''ve come to know that I have to use Inpout32.dll for accessing the port.
> I have downloaded ''Inpout32.dll'' and ''inpout.lib'', now how do I include it in my visual c++ project. I''m using Visual Studio 11 Ultimate and I''m making a c++ console application.
> What functions do I have to use to send data to the parallel port?
> Can someone point me to a good, lucid, clear tutorial/example other than http://www.lvr.com/parport.htm[^]
推荐答案
请参阅此CodeProject文章: VC ++中的硬件接口编程 - 第一部分(端口访问) [ ^ ]。
-SA
Please see this CodeProject article: Hardware Interface Programming in VC++ - Part I (Port Access)[^].
—SA
我写了这段代码:
#includestdafx.h
#include stdio.h
#includestring.h
#includestdlib.h
#include< conio.h>
短_stdcall Inp32(短PortAddress);
void _stdcall Out32(短PortAddre ss,短数据);
int main(int argc,char * argv [])
{
Out32(888,255);
system( 暂停);
Out32(888,0);
返回0;
}
这不应该首先打开所有led'然后关掉它们吗?什么也没发生。
I wrote this code:
#include "stdafx.h"
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
#include <conio.h>
short _stdcall Inp32(short PortAddress);
void _stdcall Out32(short PortAddress, short data);
int main(int argc, char* argv[])
{
Out32(888, 255);
system("pause");
Out32(888, 0);
return 0;
}
Is this not supposed to turn on all led''s first then turn them off? Nothing happened.
这篇关于使用inpout32.dll进行Visual c + +并行端口访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!