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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,955187ea690ddfda X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-25 23:20:40 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: markus.knauss@gmx.net (Markus Knauss) Newsgroups: comp.lang.ada Subject: Re: Interfacing Ada95 to C++ - Object passing problem Date: 25 Apr 2002 23:20:40 -0700 Organization: http://groups.google.com/ Message-ID: <6c12025b.0204252220.719f0909@posting.google.com> References: <6c12025b.0204250344.5944d770@posting.google.com> NNTP-Posting-Host: 193.197.156.252 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1019802040 28537 127.0.0.1 (26 Apr 2002 06:20:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 26 Apr 2002 06:20:40 GMT Xref: archiver1.google.com comp.lang.ada:23137 Date: 2002-04-26T06:20:40+00:00 List-Id: Stephen Leake wrote in message > The C value "Hello World" is _not_ of the Ada type String. String is > an Ada unconstrained array; it has bounds with it. If you want to pass > a C string to Ada code, you need to use the package > Interfaces.C.Strings, or make some compiler-dependent guesses about > how Ada strings are actually stored. That's correct. As you can see in the code I'm passing the String using Interfaces.C.Strings. This is done through the procedure "set_c". The procedure is exported with the unmangled name "set". The example gets a little obfuscated by that, my fault. The problem is with passing complex objects. In the example it is the Greeting object. Passing simple types, strings and arrays works fine. My question is why the "in out" attributes must be omitted to get it all working? I do not know why and so I'm asking if anybody knows what is going on. Thanks for your response, Markus