Pour ce qui ne connaissent pas la dll suivante : io.dll

Résolu
jackripper Messages postés 46 Date d'inscription samedi 26 mars 2005 Statut Membre Dernière intervention 11 octobre 2006 - 17 mai 2005 à 21:48
jackripper Messages postés 46 Date d'inscription samedi 26 mars 2005 Statut Membre Dernière intervention 11 octobre 2006 - 18 mai 2005 à 22:07
Bonjour tous,

Pour ceux qui ne connaissent pas ou très peut cette dll
Voici quelques indication pour les connaisseurs de la commande
d'interface par le port parallèle.


sous Delphi voici les procedures, les fonctions à mettre.
procedure PortOut(Port : Word; Data : Byte);
procedure PortWordOut(Port : Word; Data : Word);
procedure PortDWordOut(Port : Word; Data : DWord);
function PortIn(Port : Word) : Byte;
function PortWordIn(Port : Word) : Word;
function PortDWordIn(Port : Word) : DWord;
procedure SetPortBit(Port : Word; Bit : Byte);
procedure ClrPortBit(Port : Word; Bit : Byte);
procedure NotPortBit(Port : Word; Bit : Byte);
function GetPortBit(Port : Word; Bit : Byte) : WordBool;
function RightPortShift(Port : Word; Val : WordBool) : WordBool;
function LeftPortShift(Port : Word; Val : WordBool) : WordBool;
function IsDriverInstalled : Boolean;

Descriptions de quelques Fonctions

PortOut
Outputs a byte to the specified port. PortWordOut
Outputs a word (16-bits) to the specified port. PortDWordOut
Outputs a double word (32-bits) to the specified port. PortIn
Reads a byte from the specified port. PortWordIn
Reads a word (16-bits) from the specified port. PortDWordIn
Reads a double word (32-bits) from the specified port. SetPortBit
Sets the bit of the specified port. ClrPortBit
Clears the bit of the specified port. NotPortBit
Nots (inverts) the bit of the specified port. GetPortBit
Returns the state of the specified bit. RightPortShift
Shifts the specified port to the right. The LSB is returned,
and the value passed becomes the MSB. LeftPortShift
Shifts the specified port to the left. The MSB is returned,
and the value passed becomes the LSB. IsDriverInstalled
Returns non-zero if io.dll is installed and functioning.
The primary purpose of this function is to ensure that the
kernel mode driver for NT/2000/XP has been installed and is accessible.

Ce quelle contient

#include "io.h"

PORTOUT PortOut;
PORTWORDOUT PortWordOut;
PORTDWORDOUT PortDWordOut;
PORTIN PortIn;
PORTWORDIN PortWordIn;
PORTDWORDIN PortDWordIn;
SETPORTBIT SetPortBit;
CLRPORTBIT ClrPortBit;
NOTPORTBIT NotPortBit;
GETPORTBIT GetPortBit;
RIGHTPORTSHIFT RightPortShift;
LEFTPORTSHIFT LeftPortShift;
ISDRIVERINSTALLED IsDriverInstalled;

HMODULE hio;

void UnloadIODLL() {
FreeLibrary(hio);
}

int LoadIODLL() {
hio = LoadLibrary("io");
if (hio == NULL) return 1;

PortOut = (PORTOUT)GetProcAddress(hio, "PortOut");
PortWordOut = (PORTWORDOUT)GetProcAddress(hio, "PortWordOut");
PortDWordOut = (PORTDWORDOUT)GetProcAddress(hio, "PortDWordOut");
PortIn = (PORTIN)GetProcAddress(hio, "PortIn");
PortWordIn = (PORTWORDIN)GetProcAddress(hio, "PortWordIn");
PortDWordIn = (PORTDWORDIN)GetProcAddress(hio, "PortDWordIn");
SetPortBit = (SETPORTBIT)GetProcAddress(hio, "SetPortBit");
ClrPortBit = (CLRPORTBIT)GetProcAddress(hio, "ClrPortBit");
NotPortBit = (NOTPORTBIT)GetProcAddress(hio, "NotPortBit");
GetPortBit = (GETPORTBIT)GetProcAddress(hio, "GetPortBit");
RightPortShift = (RIGHTPORTSHIFT)GetProcAddress(hio, "RightPortShift");
LeftPortShift = (LEFTPORTSHIFT)GetProcAddress(hio, "LeftPortShift");
IsDriverInstalled = (ISDRIVERINSTALLED)GetProcAddress(hio, "IsDriverInstalled");

atexit(UnloadIODLL);

return 0;
}
Ou la télécharger : http://www.geekhideout.com/downloads/io.zip

2 réponses

cs_Delphiprog Messages postés 4297 Date d'inscription samedi 19 janvier 2002 Statut Membre Dernière intervention 9 janvier 2013 32
18 mai 2005 à 00:09
Elle est où la question, hein, elle est est où ???


<HR color=#008000>
Pensez à cliquer sur Réponse acceptée lorsque la réponse vous convient.
3
jackripper Messages postés 46 Date d'inscription samedi 26 mars 2005 Statut Membre Dernière intervention 11 octobre 2006
18 mai 2005 à 22:07
la question est de savoir si des personnes on déjà utilisé cette .dll ?

merci pour votre réponse
0
Rejoignez-nous