Bonjour,
Je suis actuellement en projet pour développer un programme qui gère un lecteur de RFID branché sur le port imprimante.
Pour cela, on doit utiliser la DLL inpout32.dll.

Nous avons trouver déjà des discussions pour inclure une dll dans un projet sans le même dans le System32 (Oui je suis sur Windows...).

Voici un début du programme :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
int main()
{
	typedef int (*funcIn32)(unsigned short wPort);
	typedef int (*funcOut32)(unsigned short wPort,int bOut);
	funcIn32 Inp32=NULL;
	funcOut32 Out32=NULL;
 
	HINSTANCE hDll=LoadLibrary("inpout32.dll");
	if(hDll==NULL)
	{
		// erreur
	}
 
	Inp32=(funcIn32)GetProcAddress(hDll,"Inp32");
	Out32=(funcOut32)GetProcAddress(hDll,"Out32");
 
	if(Inp32==NULL || Out32==NULL)
	{
		 // erreur
	}
 
	// voilà maintenant il y aplus qu'à faire
	WORD bRet=Inp32(0x037A);
	Out32(0x37A,0x90);
	// par exemple
 
	//Free the library at the End of the main
	FreeLibrary(hDll); 
 
 
}
Et voici mon erreur :
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.