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.0 required=5.0 tests=BAYES_00,FORGED_HOTMAIL_RCVD2, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,889b07ac9e6ac6a3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.129.169 with SMTP id nx9mr6435214pbb.2.1330619063730; Thu, 01 Mar 2012 08:24:23 -0800 (PST) Path: h9ni27253pbe.0!nntp.google.com!news1.google.com!postnews.google.com!do4g2000vbb.googlegroups.com!not-for-mail From: Gautier write-only Newsgroups: comp.lang.ada Subject: Re: Using dll from a C# code Date: Thu, 1 Mar 2012 08:24:23 -0800 (PST) Organization: http://groups.google.com Message-ID: <233c1697-d402-49a7-a556-df74cd783169@do4g2000vbb.googlegroups.com> References: <3622013.252.1330516368698.JavaMail.geo-discussion-forums@ynkz21> <189548.691.1330568785536.JavaMail.geo-discussion-forums@ynlt17> <2d391aa2-23ed-4c29-96a5-3292ae13bfb7@l7g2000vbw.googlegroups.com> <24322569.1107.1330602115411.JavaMail.geo-discussion-forums@ynjd19> <171511.1487.1330612732304.JavaMail.geo-discussion-forums@vbw15> <8428126.175.1330614914704.JavaMail.geo-discussion-forums@ynnj12> NNTP-Posting-Host: 206.122.158.4 Mime-Version: 1.0 X-Trace: posting.google.com 1330619063 22465 127.0.0.1 (1 Mar 2012 16:24:23 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 1 Mar 2012 16:24:23 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: do4g2000vbb.googlegroups.com; posting-host=206.122.158.4; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-03-01T08:24:23-08:00 List-Id: On 1 mar, 16:15, "Rego, P." wrote: > Em quinta-feira, 1 de mar=E7o de 2012 11h38min52s UTC-3, gautier...@hotma= il.com =A0escreveu: > > > Le jeudi 1 mars 2012 12:41:55 UTC+1, Rego, P. a =E9crit=A0: > > > > Actually no. I am using native .NET for generating the dll. So I just= run C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 /t:library simple.cs > > > A .NET DLL is not a traditional DLL and has not Intel machine code in i= t. > > It was called DLL just to avoid disturbing some people (and confusing o= ther). > > I don't get it. So is not possible to import a C#/.NET method in dll in a= n Ada code? Yes, you can :-). What you can't is mixing different machines. Your PC with an Intel processor and Windows is a different machine than the .NET virtual platform, with MSIL as machine code. If you compile a module with language X into machine code for machine A, and another module with language Y into another machine code, machine B/=3DA, you won't be able to make both work together. For instance you won't make a Commodore 64 machine code and a PC machine code work together. Perhaps if you think to a Commodore 64 emulator instead of the .NET platform, it will be clearer. So you need to find a common machine for compiling both languages. For C#, only one choice: MSIL For Ada, you have plenty of choices: Windows&Intel32/64, Linux&Intel32/64/..., MacOSX&PowerPC/Intel, JVM, MSIL, UNIX, OpenVMS, ... And, hurray, you realize there is one common target machine in the list: MSIL. So you have to use the GNAT-for-.NET, not the GNAT-for-Windows. Got it ?