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.3 required=5.0 tests=BAYES_00,INVALID_MSGID,XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f4e2f401b70b0129,start X-Google-Attributes: gid103376,public From: "Roger Pearse" Subject: HELP: DLL's, parameter passing problem Date: 1999/09/27 Message-ID: <938430099.1211.0.nnrp-13.c2deb6db@news.demon.co.uk>#1/1 X-Deja-AN: 529820747 X-NNTP-Posting-Host: chieftainsys.demon.co.uk:194.222.182.219 X-Trace: news.demon.co.uk 938430099 nnrp-13:1211 NO-IDENT chieftainsys.demon.co.uk:194.222.182.219 X-MSMail-Priority: Normal X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Newsgroups: comp.lang.ada X-Complaints-To: abuse@demon.net Date: 1999-09-27T00:00:00+00:00 List-Id: I'd be grateful for a bit of help. I'm trying to do a DLL in Aonix ObjectAda 7.1. I've adapted the supplied example, and I've run into difficulties when trying to pass and return a parameter (any parameter). The code runs, but the value returned seems to be random. Can anyone tell me what I'm doing wrong? Also, can I do IN OUT parameters - I'd like to pass strings. TIA Roger Pearse -----------USEDLL.EXE (console program)---------------- --Calling the DLL with ada.text_io; use ada.text_io; with ada.integer_text_io; use ada.integer_text_io; procedure UseDLL is function DLLProc(j : integer) return integer ; pragma Import(DLL,DLLProc,"DLLProc"); v,w : integer; begin v := 1; w := 1; w := DLLProc(v); put(w); end; ----------------------------DLL.DLL---------------- --Creating the DLL package P is function DLLProc(j : integer) return integer ; pragma Export(DLL,DLLProc,"DLLProc"); end; package body P is function DLLProc(j : integer) return integer is i : integer; begin i := j + 1; return i; end DLLProc; end P; with P; procedure DLL is begin null; -- perform any initializations here end; --------------------Code ends---------------------