comp.lang.ada
 help / color / mirror / Atom feed
* Interfacing with C++
@ 2001-10-10 20:01 Hagi Yilmaz
  2001-10-11 11:06 ` Peter Hend�n
  0 siblings, 1 reply; 5+ messages in thread
From: Hagi Yilmaz @ 2001-10-10 20:01 UTC (permalink / raw)
  To: comp.lang.ada

Hello,

How Can I map the "CString" in VC++ to Ada 95?

Can I pass the "CString" from VC++ as parameter to an Ada procedure or 
function.

In fact I Use at the moment the (char *) for Interface, but I have to 
allocate it from VC++ or from Ada 95 (chars_ptr) .And of course de-allocate 
it, not to cause a storage leak.

   But i thougt if i could use "CString" somehow, i would not have to deal 
with memory leaks anymore.

Can anybody help me for that? ...

Best Regards.

Hagi Yilmaz
hagihun@hotmail.com




_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




^ permalink raw reply	[flat|nested] 5+ messages in thread
* Interfacing with C++
@ 2001-06-21 20:28 Hagi Yilmaz
  2001-06-21 20:44 ` Ted Dennison
  0 siblings, 1 reply; 5+ messages in thread
From: Hagi Yilmaz @ 2001-06-21 20:28 UTC (permalink / raw)
  To: comp.lang.ada

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.




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-10-11 11:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <F2728u4xIt1YtxQEfQm00001bff@hotmail.com>
2001-10-11 11:37 ` Interfacing with C++ David Botton
2001-10-10 20:01 Hagi Yilmaz
2001-10-11 11:06 ` Peter Hend�n
  -- strict thread matches above, loose matches on Subject: below --
2001-06-21 20:28 Hagi Yilmaz
2001-06-21 20:44 ` Ted Dennison

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