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-Thread: 103376,1d6b880eb6f17222 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.180.79.138 with SMTP id j10mr1164136wix.1.1352281096330; Wed, 07 Nov 2012 01:38:16 -0800 (PST) X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 88.191.116.97 Path: q13ni177730wii.0!nntp.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!nntpfeed.proxad.net!dedibox.gegeweb.org!gegeweb.eu!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Telephony Application Programming Interface Date: Wed, 07 Nov 2012 10:38:12 +0100 Organization: Ada @ Home Message-ID: References: <1be2593a-f6c3-4ed0-b92c-351ebc5aef8b@googlegroups.com> NNTP-Posting-Host: aWaWeUaBdaj2Zzc04J1v5A.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.02 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2012-11-07T10:38:12+01:00 List-Id: Le Wed, 07 Nov 2012 09:10:24 +0100, MAriusz a =C3=A9crit= : > http://msdn.microsoft.com/en-us/library/windows/desktop/ms728171(v=3Dv= s.85).aspx > > How to do it in ADA ? Create a function definition for `CoInitializeEx` and `CoCreateInstance`= , = then instead of creating a body, imports with C++ convention. Map = constants `NULL`, `COINIT_MULTITHREADED` to Ada typed constants, with = appropriate representations and conventions. Similarly, create a mapping= = of `ITTAPI` as an Ada record. I don't know how well typical Ada compiler= s = handles C++ dispatching, so I wonder what to do for `gpTapi->Initialize(= )`. Alternatively and simpler, you may compile the whole snippet to an objec= t = file, and bind to this object file with its own simplified interface = instead of to the Windows API directly. That's a good option (something = = like pre-re-interfacing) when one don't want to bind to a full API but = only to a particular usage of it. You may look at [Annex B =E2=80=94 Interface to Other = Languages](http://www.adaic.org/resources/add_content/standards/05rm/htm= l/RM-B.html) = for more on the topic. -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity