comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: Telephony Application Programming Interface
Date: Wed, 07 Nov 2012 10:38:12 +0100
Date: 2012-11-07T10:38:12+01:00	[thread overview]
Message-ID: <op.wnec1yrpule2fv@cardamome> (raw)
In-Reply-To: k7d51e$8f0$1@news.task.gda.pl

Le Wed, 07 Nov 2012 09:10:24 +0100, MAriusz <irmar@duno.pl> a écrit:

> http://msdn.microsoft.com/en-us/library/windows/desktop/ms728171(v=vs.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 compilers  
handles C++ dispatching, so I wonder what to do for `gpTapi->Initialize()`.

Alternatively and simpler, you may compile the whole snippet to an object  
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 — Interface to Other  
Languages](http://www.adaic.org/resources/add_content/standards/05rm/html/RM-B.html)  
for more on the topic.


-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University



  reply	other threads:[~2012-11-07  9:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31  9:43 Telephony Application Programming Interface MAriusz
2012-10-31 14:59 ` Shark8
2012-11-07  8:10   ` MAriusz
2012-11-07  9:38     ` Yannick Duchêne (Hibou57) [this message]
2012-11-07 13:35     ` Anonymous
2012-11-07 11:12 ` kylix
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox