From: "NANCY HEHIR" <nanceh.ennis@tinet.ie>
Subject: Re: Access and alias
Date: 2000/04/04
Date: 2000-04-04T00:00:00+00:00 [thread overview]
Message-ID: <v7rG4.1684$sB3.964@news.indigo.ie> (raw)
In-Reply-To: 86d7o5ae23.fsf@ppp-169-201.villette.club-internet.fr
I am trying to use SetCommState to configure a Comm Port.
I have created a handle for COM1 using CreateFile.
SetCommState takes as it's parameters the handle and a type LPDCB (access to
the DCB)
The type LPDCB is defined in Win32-winbase.ads
Thanks for your help
Laurent Guerby wrote in message
<86d7o5ae23.fsf@ppp-169-201.villette.club-internet.fr>...
>
>Try:
>
> DCB_1 : aliased DCB;
>
>> .
>> .
>> DCB_Access:LPDCB := DCB'Access;
>>
>> compiler generates error 'prefix of "Access" attribute must be aliased'
>
>However, it is very "rare" in Ada to use aliased variables, if you're
>from a C background and try to write Ada like you write C I think
>adding "aliased" and "'access" everywhere is not the right thing to
>do. A possible guess is that you are emulating the use of "&" in C
>with aliased/access, and that the right way to do it in Ada is to use
>the "in out" parameter mode.
>
>May be if you tell us more about what you're trying to do, we can
>suggest appropriate Ada idioms (note that may be the use of aliased
>and access is the appropriate idiom here ;-).
>
>--LG
next prev parent reply other threads:[~2000-04-04 0:00 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-04-04 0:00 Access and alias NANCY HEHIR
2000-04-04 0:00 ` tmoran
2000-04-04 0:00 ` Laurent Guerby
2000-04-04 0:00 ` NANCY HEHIR [this message]
2000-04-04 0:00 ` Laurent Guerby
2000-04-05 0:00 ` Alfred Hilscher
2000-04-05 0:00 ` Laurent Guerby
2000-04-05 0:00 ` Ted Dennison
2000-04-05 0:00 ` Jeff Carter
2000-04-06 0:00 ` Robert Dewar
2000-04-07 0:00 ` Jeff Carter
2000-04-06 0:00 ` Alfred Hilscher
2000-04-07 0:00 ` Jeff Carter
2000-04-06 0:00 ` tmoran
2000-04-07 0:00 ` Robert Dewar
2000-04-07 0:00 ` tmoran
2000-04-09 0:00 ` Robert Dewar
2000-04-09 0:00 ` tmoran
2000-04-10 0:00 ` Jack W. Sharer
2000-04-06 0:00 ` Robert Dewar
2000-04-05 0:00 ` Jeffrey D. Cherry
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox