comp.lang.ada
 help / color / mirror / Atom feed
* Graphic and C/C++ programs in Ada?
@ 1999-06-17  0:00 ` mehrdad1
  1999-06-17  0:00   ` David Botton
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: mehrdad1 @ 1999-06-17  0:00 UTC (permalink / raw)


Dear friends,
I am a beginner to Ada.So I have a lot of questions about Ada.
These are some of them:
1-What is the equivalent instruction in Ada for "gotoxy" in
c/c++?
2-Is it possible to write graphical programs with Ada?
3-Is it possible to use already written C/C++ programs in a
new Ada program?(Then can we use from synchronizing ability of
Ada programming?)
Thank you very much for your valuable time and assistance.
With kind regards.
Sincerely yours,
Mehrdad Derakhshan.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




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

* Re: Graphic and C/C++ programs in Ada?
  1999-06-17  0:00 ` mehrdad1
  1999-06-17  0:00   ` David Botton
@ 1999-06-17  0:00   ` Decker, Christian R
  1999-06-17  0:00   ` Tarjei Tj�stheim Jensen
  2 siblings, 0 replies; 5+ messages in thread
From: Decker, Christian R @ 1999-06-17  0:00 UTC (permalink / raw)


I don't know of any _standard_ Ada libraries that include similar routines
to the gotoxy.  I have
 seen some non-standard packages that will perform these functions however,
but you would have to search
for them.

As far as Ada and C/C++ this is possible.  I have posted some questions
relating to this topic.  I have done
extensive interfacing with C/C++ using Ada.  There are some tricks when C++
gets invloved due to the wonderful
'name mangling' that C++ compilers do, but good ol' C is no prob.

Create an Ada package that prototypes the C function you wish to interface
to.  Use a procedure prototype for
functions with no return values.  Make sure you match the parameter profile.
Ada95 has an Interfaces.C package
which is very useful.

i.e.
Package X is

   procedure C_Function ( Param1 : Integer ) ;

   pragma Import ( C , C_Function , "C_Function") ;

end X ;

See earlier questions on Ada to C++ for info on that.  Once you have the
protype, just add the object or lib file to
gnatlink to resolve the interfaced functions.

Also.... As far as writing graphical programs with Ada, it is possible.
Gnat 3.11 has built in Win32 libraries so
if you program the Win API using C, you can do it with Gnat 3.11.  Also
there are bindings to the X windows
system as well.  Just search for them on the Net.  It is quite easy to get
working.  I have also created my own
bindings to the OpenGL routines on an SGI machine, but would work on any
Unix box.  If anyone is interested
in getting the bindings, post it and i'll try to get you the source.

Anyway.. good luck.



   -**** Posted from RemarQ, http://www.remarq.com/?a ****-
 Search and Read Usenet Discussions in your Browser - FREE -




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

* Re: Graphic and C/C++ programs in Ada?
  1999-06-17  0:00 ` mehrdad1
  1999-06-17  0:00   ` David Botton
  1999-06-17  0:00   ` Decker, Christian R
@ 1999-06-17  0:00   ` Tarjei Tj�stheim Jensen
  2 siblings, 0 replies; 5+ messages in thread
From: Tarjei Tj�stheim Jensen @ 1999-06-17  0:00 UTC (permalink / raw)



mehrdad1@my-deja.com wrote:

 >1-What is the equivalent instruction in Ada for "gotoxy" in
>c/c++?

This is possibly a Borland specific function. I seems to remember it being used
in DOS programming many years ago. The Ada equivalent depends on what
environment you program in. E.g. Unix or windows.

You may have to write your own versions of that function or use an exisiting
library. Doing it yourself is not neccessarily difficult, but perhaps a lot of
work. If you want to find out how, have a look in the library to see how any
socket routines are done. They should import routines from C libraries.

Try looking around in http://www.adahome.com or http://www.adapower.com/. The
latter may be more appropriate if you use windows.

>2-Is it possible to write graphical programs with Ada?

Yes there is quite a few libraries available.


>3-Is it possible to use already written C/C++ programs in a
>new Ada program?(Then can we use from synchronizing ability of
>Ada programming?)


It is probably possible, but not neccessarily easy to do. You may want to look
this up in the compiler documentation if you can find it.


Greetings,







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

* Re: Graphic and C/C++ programs in Ada?
  1999-06-17  0:00 ` mehrdad1
@ 1999-06-17  0:00 Dale Stanbrough
  1999-06-17  0:00 ` mehrdad1
  2 siblings, 1 reply; 5+ messages in thread
From: Dale Stanbrough @ 1999-06-17  0:00 UTC (permalink / raw)


mehrdad1 wrote:

" Dear friends,
  I am a beginner to Ada.So I have a lot of questions about Ada.
  These are some of them:
  1-What is the equivalent instruction in Ada for "gotoxy" in
  c/c++?"

   gotoxy, no doubt!

Actually you are talking about function call. There is -no-
gotoxy in C/C++ (please try and understand the difference b/w
a language and a specific implementation).


" 2-Is it possible to write graphical programs with Ada?"

   yes


" 3-Is it possible to use already written C/C++ programs in a
  new Ada program?(Then can we use from synchronizing ability of
  Ada programming?)"


   C -easily, C++ a bit harder.

Dale




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

* Re: Graphic and C/C++ programs in Ada?
  1999-06-17  0:00 ` mehrdad1
@ 1999-06-17  0:00   ` David Botton
  1999-06-17  0:00   ` Decker, Christian R
  1999-06-17  0:00   ` Tarjei Tj�stheim Jensen
  2 siblings, 0 replies; 5+ messages in thread
From: David Botton @ 1999-06-17  0:00 UTC (permalink / raw)



mehrdad1@my-deja.com wrote in message <7k9t72$8k2$1@nnrp1.deja.com>...
>Dear friends,
>I am a beginner to Ada.So I have a lot of questions about Ada.
>These are some of them:
>1-What is the equivalent instruction in Ada for "gotoxy" in
>c/c++?

Gotxy is not part of c/c++ or Ada, but you can find packages that support
screen handling at:

http://www.adapower.com/reuse

>2-Is it possible to write graphical programs with Ada?

Yes, take a look at examples at:

http://www.adapower.com/os

This covers, Java, GTK, and Win32

Also see http://members.xoom.com/gdemont/e3d.htm for Gautier's Engine_3D
package

>3-Is it possible to use already written C/C++ programs in a
>new Ada program?(Then can we use from synchronizing ability of
>Ada programming?)

Yes and even COM and CORBA objects.

>Thank you very much for your valuable time and assistance.
>With kind regards.
>Sincerely yours,
>Mehrdad Derakhshan.
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.






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

end of thread, other threads:[~1999-06-17  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-17  0:00 Graphic and C/C++ programs in Ada? Dale Stanbrough
1999-06-17  0:00 ` mehrdad1
1999-06-17  0:00   ` David Botton
1999-06-17  0:00   ` Decker, Christian R
1999-06-17  0:00   ` Tarjei Tj�stheim Jensen

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