From: "Hagi Yilmaz" <hagihun@hotmail.com>
To: comp.lang.ada@ada.eu.org
Subject: Interfacing with C++
Date: Thu, 21 Jun 2001 23:28:46 +0300
Date: 2001-06-21T23:28:46+03:00 [thread overview]
Message-ID: <mailman.993155362.16396.comp.lang.ada@ada.eu.org> (raw)
Hello,
I have a little problem in Mapping C++, char * to Ada 95
c.strings_chars_ptr.
in C++ code :
"
....
extern "C" {void ada_call (char *x) }; // ada function I call.
. . .
char *x;
x=(char *) malloc(100);
ada_call(x);
MessageBox(x);
. . .
"
in ada code :
"
procedure ada_call(x : in out c.strings_chars_ptr) is
begin
x:=New_String(Str => "xxx"); -- x changes...
end ada_call;
. . .
"
My problem : In C code I write the output by "MessageBox" but see incorrect
characters are returning from Ada.
How should I build the Interface?
When there is a c.strings_chars_ptr with "in out" parameter,
how can I get correct returnings from ada in such a case?
How should be the Ada and C codes?
Can anybody help me for that? ...
Hagi Yilmaz
hagihun@hotmail.com
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
next reply other threads:[~2001-06-21 20:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-21 20:28 Hagi Yilmaz [this message]
2001-06-21 20:44 ` Interfacing with C++ Ted Dennison
-- strict thread matches above, loose matches on Subject: below --
2001-10-10 20:01 Hagi Yilmaz
2001-10-11 11:06 ` Peter Hend�n
[not found] <F2728u4xIt1YtxQEfQm00001bff@hotmail.com>
2001-10-11 11:37 ` David Botton
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox