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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,47957cb8c33729e5 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Newsgroups: comp.lang.ada Subject: Re: Thick Ada bindings to C Win32 References: <2vjnfbF2lioiaU1@uni-berlin.de> <1Ucld.25101$KJ6.2286@newsread1.news.pas.earthlink.net> From: Brian May Date: Fri, 26 Nov 2004 10:19:59 +1100 Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:sDcBVOn6R92ClZpkPTJe+tjFMes= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: snoopy.microcomaustralia.com.au X-Trace: news.melbourne.pipenetworks.com 1101424778 202.173.153.89 (26 Nov 2004 09:19:38 +1000) X-Complaints-To: abuse@pipenetworks.com X-Abuse-Info: Please forward all headers to enable your complaint to be properly processed. Path: g2news1.google.com!news4.google.com!news.glorb.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-north.connect.com.au!duster.adelaide.on.net!news.melbourne.pipenetworks.com!not-for-mail Xref: g2news1.google.com comp.lang.ada:6489 Date: 2004-11-26T10:19:59+11:00 List-Id: >>>>> "Jeffrey" == Jeffrey Carter writes: Jeffrey> Assuming that Lp[c?]void is a convention-C access type, Jeffrey> you can safely convert between convention-C access types Jeffrey> using Unchecked_Conversion. Your best bet may be to Jeffrey> declare such an access type designating a Byte_Array Jeffrey> (maybe you want Storage_Array here?), declare Item_Buffer Jeffrey> aliased, store its 'Unchecked_Access in a variable of the Jeffrey> appropriate type, and convert it to the Win32 access Jeffrey> type. The most obvious problem is as soon as I make Item_Buffer aliased, I need to make a complete copy of it. Question: Is S'Address the same as S(S'First)'Address? Maybe the best approach might be: function To_LPCVOID is new Ada.Unchecked_Conversion (System.Address, Win32.LPCVOID); To_LPCVOID(Item'Address) or To_LPCVOID(Item(Item'First)'Address) Depending on the answer to my previous question. -- Brian May