Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/152.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
visualc&x2B+;并口控制 我在Visual C++中编写了该代码,通过并行端口控制LED:_C++_Parallel Processing_Port - Fatal编程技术网

visualc&x2B+;并口控制 我在Visual C++中编写了该代码,通过并行端口控制LED:

visualc&x2B+;并口控制 我在Visual C++中编写了该代码,通过并行端口控制LED:,c++,parallel-processing,port,C++,Parallel Processing,Port,//InputTest.cpp:定义控制台应用程序的入口点。 // #包括“stdafx.h” #包括“stdio.h” #包括“string.h” #包括“stdlib.h” #包括 短_stdcallinp32(短端口地址); void _stdcallout32(短端口地址、短数据); int main(int argc,char*argv[]) { Out32(888255); 系统(“暂停”); Out32(888,0); 返回0; } 现在,我想到的是“Out32(888255);

//InputTest.cpp:定义控制台应用程序的入口点。 //

#包括“stdafx.h”
#包括“stdio.h”
#包括“string.h”
#包括“stdlib.h”
#包括
短_stdcallinp32(短端口地址);
void _stdcallout32(短端口地址、短数据);
int main(int argc,char*argv[])
{
Out32(888255);
系统(“暂停”);
Out32(888,0);
返回0;
}
现在,我想到的是“Out32(888255);”一行将在所有数据寄存器中写入1,所有从D0连接到D7的LED将点亮;但什么也没发生,行刑前亮着的led灯一直亮着,与熄灭的led灯情况相同

‘Out32(888,0);’的情况也是如此,没有led被关闭

上面的代码有什么错误?我在使用64位操作系统(windows 8)时使用了“input x64.dll”。我还在项目属性>链接>输入>其他依赖项中包含了“inputx64.lib”


我也抄了“inputX64.dll”到Windows/system 32

确保您的
inputX64.dll
与生成的
.exe
文件位于同一目录中,并且您已运行
inputX64.dll
附带的
InstallDriver.exe
程序,并允许UAC提升,以安装所需的系统驱动程序。

您是否将其编译为在保护模式下运行?还是真实模式?也就是说,你会在windows下运行它吗?是的,我会在windows下运行它,更具体地说,在windows 8的windows 7下(32/644位),InstallDriver.exe没有随“input x64.dll”下载而来。我在哪里可以得到它,它的用途是什么?应该可以从-虽然我个人没有使用过64位版本的这个(只有32位版本),我应该使用哪个版本,32位还是64位版本?我的操作系统是64位,但是我正在构建的C++控制台应用程序是32位。如果你的操作系统是X64,我相信64位。DLL/驱动程序是走的路。
 #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;
 }