Bonjour,
J'ai un petite question, je vaidrais passer
inp32 et
oup32 dans la fonction
FonctionDivers().
comment faire ?
Ce fragment de code commande le port LPT, il devrait lui envoyer la
valeur 255 depuis la fonction FonctionDivers(), mais il ne compile car
il ne reconnait pas
(oup32).
typedef short _stdcall (*inpfuncPtr)(short portaddr);
typedef void _stdcall (*oupfuncPtr)(short portaddr, short datum);
void FonctionDivers();
int main(int argc, char *argv[])
{
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;
}
FonctionDivers();
FreeLibrary(hLib);
system("PAUSE");
return 0;
}
FonctionDivers()
{
(oup32)(0x378,255);
}