|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Junior Member
Iscritto dal: Jan 2002
Messaggi: 16
|
gestire la LPT sotto windows xp
ho fatto un programma in delphi per la gestione della porta parallela. Per inviare i bit ai pin della stessa ho utilizzato una procedure assembler molto semplice:
var i:word; begin asm mov ax,i mov dx,378h out dx,ax end; end. in cui " i " è il valore da dare alla porta parallela. L'unico problema è che sotto win 98 e win Me il programma funziona correttamente, sotto win 2000 e Xp viene segnalato un errore "priviliged istruction" cosa posso fare? ho pensato alla possibilità di utilizzare le api di windows, ma non le conosco così a fondo!!! |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
|
Per NT, 2k e XP devi usare le API di Windows...l'utente non può accedere direttamente alle routine hardware.
|
![]() |
![]() |
![]() |
#3 |
Junior Member
Iscritto dal: Jan 2002
Messaggi: 16
|
sì ma quali sono le funzioni api da utilizzare? è questo che vorrei sapere!
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
|
CreateFile, ReadFile, WriteFile, CloseHandle
Da MSDN : Communications Resources The CreateFile function can create a handle to a communications resource, such as the serial port COM1. For communications resources, the dwCreationDisposition parameter must be OPEN_EXISTING, and the hTemplate parameter must be NULL. Read, write, or read-write access can be specified, and the handle can be opened for overlapped I/O. For more information about communications, see Communications. |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 00:16.