Du kan læse lidt om det her:
http://www.codeproject.com/csharp/csppleds.asp ellers har jeg lavet et lille program der tænder og slukker nu du trykker på en tast.
#include <iostream.h>
#include <stdio.h>
#include <conio.h>
#include <windows.h>
#include <time.h>
typedef short _stdcall (*inpfuncPtr)(short portaddr);
typedef void _stdcall (*oupfuncPtr)(short portaddr, short datum);
using namespace std;
int main(void)
{
HINSTANCE hLib;
inpfuncPtr inp32;
oupfuncPtr oup32;
/* Load the library */
hLib = LoadLibrary("inpout32.dll");
if (hLib == NULL) {
printf("LoadLibrary Failed.\n");
return -1;
}
/* get the address of the function */
inp32 = (inpfuncPtr) GetProcAddress(hLib, "Inp32");
if (inp32 == NULL) {
printf("GetProcAddress for Inp32 Failed.\n");
return -1;
}
oup32 = (oupfuncPtr) GetProcAddress(hLib, "Out32");
if (oup32 == NULL) {
printf("GetProcAddress for Oup32 Failed.\n");
return -1;
}
while(1)
{
(oup32)(0x378,255);
cout << "The light is on!" << endl;
cin.get();
(oup32)(0x378,0);
cout << "The light is off!" << endl;
cin.get();
}
FreeLibrary(hLib);
return 0;
}