comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Re: newbie q: access types getting address
Date: Thu, 14 Jun 2001 01:49:56 GMT
Date: 2001-06-14T01:49:56+00:00	[thread overview]
Message-ID: <8LUV6.89298$%i7.66087391@news1.rdc1.sfba.home.com> (raw)
In-Reply-To: tifu13m7rmgr7b@corp.supernews.com

>I want to get the address of a particular object that is getting passed into
>...
>in Ada, but this is for a Windows API call binding.  Sorry if this is
  For a Windows binding you almost certainly want 'access, not 'address.
(Though System.Address_To_Access_Conversions can interconvert the two.)

>return &Obj;
>and
>return &Array[5];
 return Obj'access;
 return Array(5)'access;
If you get accessibility level errors, the compiler is telling you
that you are creating a pointer that may outlive what it's pointing to.
If you're sure what you are doing is safe, you can
  return Obj'unchecked_access;
etc.  You'll see a lot of that in Ada code accessing Windows' API.



  parent reply	other threads:[~2001-06-14  1:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-13 23:24 newbie q: access types getting address Jesse Farmer
2001-06-13 23:56 ` James Rogers
2001-06-14  1:49 ` tmoran [this message]
2001-06-14 13:52 ` Jesse Farmer
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox