comp.lang.ada
 help / color / mirror / Atom feed
From: ebeser@rigperson.atsc.allied.com (Eric Beser)
Subject: Re: Calling C++ from within ADA
Date: 8 Nov 1994 15:22:16 GMT
Date: 1994-11-08T15:22:16+00:00	[thread overview]
Message-ID: <39o538$d0h@paperboy.gsfc.nasa.gov> (raw)
In-Reply-To: CVANOVER.1.0007E49E@bamanet.ua.edu

We call C++ from Ada by doing the following.

If the C++ object has been created before calling Ada, A "This Ptr"
needs
to be passed to the Ada for the object that is to be called. The This
Ptr
points to the object of reference.

If other objects needed to be accessed, you can do it by getting other
"This Ptr" pointers.
The calling interface from Ada to C++ has to be to an extern "C"
function.

However this function can be defined in the H file. The "This Ptr" is
used
to access class member functions from the calling interface.

The other rule is that no object can be called unless elaborated first.
This includes Ada and C++.

Hope this helps.


Eric Beser



  parent reply	other threads:[~1994-11-08 15:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-11-03 12:53 Calling C++ from within ADA CVANOVER
1994-11-03 15:11 ` Norman H. Cohen
     [not found] ` <CypvDM.8q5@nntpa.cb.att.com>
1994-11-04 17:31   ` Greg Harvey
1994-11-04 17:46     ` Greg Harvey
1994-11-07  2:52 ` Oliver E. Cole
1994-11-08 15:22 ` Eric Beser [this message]
1994-11-08 18:34 ` Richard G. Hash
replies disabled

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