From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Port LPT + ADA (whta do I wrong?)
Date: Sat, 4 Dec 2004 21:20:21 +0100
Date: 2004-12-04T21:20:21+01:00 [thread overview]
Message-ID: <1gr5159dmj2vk.5tkxiw6kxrmv.dlg@40tude.net> (raw)
In-Reply-To: cosu9o$mnk$1@kujawiak.man.lodz.pl
On Sat, 4 Dec 2004 19:05:44 +0100, S�awo - MIR wrote:
> Maybe someone tell me what do I wrong (??), or maybe everything is wrong ;-)
Only Hungarian notation is wrong! (:-))
> These are the fragments of my code:
>
> Variables:
>
> hLPT : Win32.Winnt.HANDLE;
> struktura : Win32.Winbase.LPOVERLAPPED;
^^^^^^^^^^^^^^
This is a pointer!
I presume (depending on the Win32 bindings, you are using) it should be:
struktura : aliased Win32.Winbase.OVERLAPPED;
> read : aliased DWORD;
>
> type LPT1_Bajt is record
> Busy : boolean;
> ACK : boolean;
> Paper : boolean;
> Sel : boolean;
> Error : boolean;
> Trzy_z : boolean;
> end record;
>
> for LPT1_Bajt use record
> Busy at 0 range 7..7; --pin 11 (zanegowany)
> ACK at 0 range 6..6; --pin 10
> Paper at 0 range 5..5; --pin 12
> Sel at 0 range 4..4; --pim 13
> Error at 0 range 3..3; --pin 15
> Trzy_z at 0 range 0..2; --trzy zera na poczatku
> end record;
>
> Reading from LPT Port:
>
> st : aliased LPT1_Bajt;
>
> struktura.OffsetHigh := 16#379#;
>
> !!!! In this place (after compiling, building and runnig it) appears an
> error: "CONSTRAINT_ERROR access check failed" !!!!
Yes, because structura = null
> if Win32.Winbase.Readfile(hLPT, st'address, Dword(1), read'access,
> struktura) =
That should be structura'Access, accordingly.
> Win32.False then
> Put_Line ("Nie udalo sie odpalic LPT");
> raise LPT_Error;
> end if;
>
> Opening LPT port:
>
> hLPT := Win32.Winbase.CreateFile ( CP ("LPT1" & ASCII.Nul),
> Win32.Winnt.GENERIC_READ,
> 0,
> null,
> Win32.Winbase.OPEN_EXISTING,
> Win32.Winbase.FILE_FLAG_OVERLAPPED,
> System.Null_Address);
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2004-12-04 20:20 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-03 13:56 Port LPT + ADA S�awo - MIR
2004-12-03 14:40 ` Martin Krischik
2004-12-03 15:29 ` Slawo - MIR
2004-12-03 18:46 ` Martin Krischik
2004-12-03 18:43 ` tmoran
[not found] ` <u111r0db4fsoj9u3hlkachspjt0r2vvup7@4ax.com>
2004-12-03 23:03 ` Adrien Plisson
2004-12-03 23:51 ` Slawo - MIR
2004-12-04 0:51 ` Jeffrey Carter
2004-12-04 18:05 ` Port LPT + ADA (whta do I wrong?) S�awo - MIR
2004-12-04 20:20 ` Dmitry A. Kazakov [this message]
2004-12-07 18:13 ` Slawo - MIR
2004-12-07 20:55 ` Dmitry A. Kazakov
2004-12-08 4:28 ` Steve
2004-12-08 8:27 ` Dmitry A. Kazakov
2004-12-12 22:25 ` Brian May
2004-12-14 2:41 ` Steve
2004-12-12 22:46 ` Brian May
2004-12-12 23:03 ` Adrien Plisson
[not found] ` <rt8dr09tuvgbqaeq9vmujd1pqtb72hbamv@4ax.com>
2004-12-09 8:17 ` Jerry van Dijk
2004-12-05 6:45 ` Brian May
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox