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,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,9302958eecfda77 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-08 11:41:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: "Beard, Frank [Contractor]" Newsgroups: comp.lang.ada Subject: RE: Binding to functions having reference parameter Date: Wed, 8 May 2002 14:39:30 -0400 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: avanie.enst.fr 1020883262 18103 137.194.161.2 (8 May 2002 18:41:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 8 May 2002 18:41:02 +0000 (UTC) Return-Path: X-Mailer: Internet Mail Service (5.5.2650.21) Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.8 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:23734 Date: 2002-05-08T14:39:30-04:00 function ApiCmdBite ( bModule : My_Win32.UCHAR; biu : My_Win32.UCHAR; sc : My_Win32.UCHAR; bite_status : access My_Win32.UCHAR_Array2 ); return My_Win32.SHORT; Then, the variable you have declared to pass to it needs to be something like: new_bite_status : aliased My_Win32.UCHAR_Array2; So, that when you call it, it will look something like return_code :=3D ApiCmdBite ( bModule =3D> ???, biu =3D> ???, sc =3D> ???, bite_status =3D> new_bite_status'access); Frank -----Original Message----- From: Antonio L=F3pez [mailto:alm@gtd.es.REMOVE] Sent: Wednesday, May 08, 2002 10:40 AM To: comp.lang.ada@ada.eu.org Subject: Binding to functions having reference parameter I am doing a binding to a Dll Using Win32 binding and I have a problem = with functions having reference parameters (an C array). =BFHow must I declare those parameters? (ada functions doesn't allow = out parameters) One example: Dll fucntion is declared as : _API_EXTERN AiInt16 _API_DLL_FUNC ApiCmdBite (AiUInt8 bModule, AiUInt8 = biu, AiUInt8 sc, AiUInt8 bite_status[]); And I declare: subtype UCHAR is Interfaces.C.unsigned_char; type UCHAR_Array2 is array (0 .. 1) of aliased UCHAR; function ApiCmdBite ( bModule : My_Win32.UCHAR; biu : My_Win32.UCHAR; = sc : My_Win32.UCHAR; bite_status : My_Win32.UCHAR_Array2 ) return My_Win32.SHORT; However I get a warning: "bite_status" is never assigned a value, = calling the fucntion. Obvius It needs to be done otherwise! Could you enlight me please? I have tried to pass the parameter as bite_status : Interfaces.C.unsigned_char'Address but I get the error: attribute = "Address" may not be used in a subtype mark I should be able to use for example: 'bite_status(0) :=3D 1;' or 'if (bite_status(1) =3D=3D 2)' _______________________________________________ comp.lang.ada mailing list comp.lang.ada@ada.eu.org http://ada.eu.org/mailman/listinfo/comp.lang.ada