From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,82beb998ad3cbee4 X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: Using windows API functions Date: 1998/07/10 Message-ID: #1/1 X-Deja-AN: 370335056 References: <900065152.385075@dedale.pandemonium.fr> <6o569h$p78$1@cnn.Princeton.EDU> Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Newsgroups: comp.lang.ada Date: 1998-07-10T00:00:00+00:00 List-Id: mcc@tyrolia.cs.princeton.edu (Martin C. Carlisle) writes: > In article <900065152.385075@dedale.pandemonium.fr>, > Antoine JORGE RIBEIRO wrote: > >hi! > >I desesperatly try to manage with the function ReadFile from Win32.Winbase, > >in object ada (Aonix) and I don't understand How to use it and How the > >lpBuffer : Win32.lpVoid might be used. > >what's lpVoid, How can I Point to an array of Byte (mod 2**8). > > Win32Ada binds to C, where one can go from (void *) to (char *) at the > drop of a hat. In Ada, I'd suggest an Unchecked_Conversion from > your pointer type to Win32.lpvoid. > Actually, if you read the Win32Ada source code (always a good idea!), you will find that Win32.lpvoid is just a renaming of System.Address. Thus to find lpvoid for a buffer: Data : my_data_type; use 'address: ReadFile (lpBuffer => Data'address, ... ); Have fun! -- Stephe