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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4e101bd1b1b0a66c X-Google-Attributes: gid103376,public From: dkristol@pollock.artists (David Kristola) Subject: Re: Calling Ada proceedures from a C program Date: 1999/06/10 Message-ID: <7jne6d$5p55@svlss.lmms.lmco.com>#1/1 X-Deja-AN: 487776334 Distribution: world References: <7jlsqd$khj$1@nnrp1.deja.com> Organization: heheh Reply-To: dkristol@pollock.artists Newsgroups: comp.lang.ada Date: 1999-06-10T00:00:00+00:00 List-Id: In article 1@nnrp1.deja.com, rekennedy@my-deja.com () writes: >I'm having trouble getting the same thing to work for strings. For the >strings, I ended up using the "char_ptr" type from Interfaces.C.Strings. >On the c-side, the values are char *, on the Ada-side, they are >char_ptr. The C calls the Ada procedure without a problem, until the >code starts to return to the C, passing the value back. At that point, >it raises an access violation. Still not sure what I'll have to do to >get this working. If anyone has done this, I'd really appreciate any >advice on it. > >I'll list the specs, headers, etc of the files here as an example of >one way of doing this. Hopefully it will keep someone else from having >the same frustrations looking for examples. > > >Robert Kennedy >Science Applications International Corporation (SAIC) You did not include the body for My_Test_Package, so i am not sure what it is doing, but the problem may be in the way out parameters are handled. As with the integer case, Ada may use a pointer to the string pointer. I am sure this is in the documentation somewhere, but i do not have it close at hand. --djk, keeper of arcane lore & trivial fluff Home: David95037 at aol dot com Spam: goto.hades@welovespam.com