//Lpt.cpp #include <windows.h> #include <conio.h> //DLL的入口函数 BOOL WINAPI DLLEntrePoint( HINSTANCE hinstDLL, // handle to DLL module DWORD fdwReason,//reason for calling function LPVOID lpvReserved) // reserved {switch (fdwReason) {case DLL_PROCESS_ATTACH: {//可加入初始化代码 break;} case DLL_PROCESS_DETACH: {//可加入清除代码 break;}} return true;} Unsigned char InPort(unsigned int port) {return _inp(port);} int OutPort(unsigned int port,unsigned char value) {_outp(port,value); return 1;} LIBRARY LPT DESCRPRPTION "Lpt.dll" CODE PRELOAD MOVEABLE DDSCARDABLE DATA PRELOAD SINGLE EXPORTS Inport @1 Outport @2 下面是显示的错误信息 <html> <body> <pre> <h1>Build Log</h1> <h3> --------------------Configuration: 1 - Win32 Debug-------------------- </h3> <h3>Command Lines</h3> Creating temporary file "C:\DOCUME~1\mcharry\LOCALS~1\Temp\RSP21.tmp" with contents [ /nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Debug/1.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c "C:\Documents and Settings\mcharry\桌面\1.cpp" ] Creating command line "cl.exe @C:\DOCUME~1\mcharry\LOCALS~1\Temp\RSP21.tmp" <h3>Output Window</h3> Compiling... 1.cpp C:\Documents and Settings\mcharry\桌面\1.cpp(17) : error C2144: syntax error : missing ';' before type 'char' C:\Documents and Settings\mcharry\桌面\1.cpp(17) : error C2501: 'Unsigned' : missing storage-class or type specifiers C:\Documents and Settings\mcharry\桌面\1.cpp(17) : fatal error C1004: unexpected end of file found Error executing cl.exe.
<h3>Results</h3> 1.obj - 3 error(s), 0 warning(s) </pre> </body> </html>