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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1fb2c23b98beed60 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!d4g2000prg.googlegroups.com!not-for-mail From: axtens Newsgroups: comp.lang.ada Subject: Re: Access to data indirection (newbie) Date: Tue, 27 Nov 2007 19:04:28 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <1a812241-65fc-403a-927f-b2651b4107e3@s8g2000prg.googlegroups.com> <474bd14a$1@news.post.ch> NNTP-Posting-Host: 165.228.152.196 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1196219068 16854 127.0.0.1 (28 Nov 2007 03:04:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 28 Nov 2007 03:04:28 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d4g2000prg.googlegroups.com; posting-host=165.228.152.196; posting-account=1W9SuAoAAAApKJ8N7QNszANYOyWIVzjG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9,gzip(gfe),gzip(gfe) Content-Disposition: inline Xref: g2news1.google.com comp.lang.ada:18653 Date: 2007-11-27T19:04:28-08:00 List-Id: On Nov 28, 7:20 am, Simon Wright wrote: > Martin Krischik writes: Well, anyway, I figured out a solution to my question, after reading the "Summary of Operations on Access Values" in Feldman's "Software Construction and Data Structures with Ada 95." For ages I couldn't figure out why I felt a prompting to pick this book up at a booksale in the local library. Now I think I know what God was up to. Nevertheless, thanks to both of you for adding your two bob's worth to the mix. What I've ended up with, at least this far in, is: VB6: Declare Function handlepointer Lib "release\api.dll" (ByVal x As Long) As Long Dim i As Long i = 1001 Debug.Print VarPtr(i) Debug.Print handlepointer(VarPtr(i)) Output: 1309644 1001 Api.ads (part of): function HandlePointer ( Left : in Win32.LONG) return Win32.LONG; ... pragma Export (DLL, HandlePointer ); Api.adb (part of): function HandlePointer ( Left : in Win32.LONG) return Win32.LONG is type LongRec is record L : Win32.LONG; end record; type PointerToLongRec is access LongRec; function Conv is new Unchecked_Conversion (Win32.LONG, PointerToLongRec ); PLongRec : PointerToLongRec; begin PLongRec := Conv(Left); return PLongRec.All.L; end HandlePointer; Kind regards, Bruce.