comp.lang.ada
 help / color / mirror / Atom feed
* Ada in control - Win32 GUI - Possible?
@ 1997-11-03  0:00 Dave Smith
  1997-11-04  0:00 ` Stephen Leake
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Smith @ 1997-11-03  0:00 UTC (permalink / raw)



Hello,

I posted a question a couple of weeks ago about Ada
being callable from Visual Basic (thanks for the many
replies).

My current question is related:

   Can an Ada program be in control of a Win32 GUI?

Actually, this is a simplification of my question.  I
am working in a situation where I cannot (in a cost-
effective manner) rewrite the existing Ada main program.
My application is a client (currently on an SG platform
w/ a Motif GUI) of a low-level "OS-ish" layer written in
Ada.  This layer is an API that exposes resources such
as shared memory, sockets, GPS time, and interfaces to
specialized high-speed networking cards.  This layer is
built for a heterogeneous environment (Suns, SGs, and
VME chasses).  Because many of these services need to be
properly initialized before an application can use them
(and properly shut down after an application finishes
with them), this layer "likes to be in control".

While there are applications within our project that
require all the speed and power that this "OS-ish"
layer provides, mine is not one of them.  I *am* built
on top of the layer (by choice), but use it almost
exclusively for its inter-process communication services
(I also use the interface to the GPS clock).

However, I would like to move to a Win32 platform to
take advantage of a RAD tool such as Visual Basic.
Based on responses to my post of two weeks ago, I can
call (from Visual Basic) Ada code that has been
compiled into a DLL.  But I'd like to remain built on
top of a reworked (for Win32) and recompiled (not
redesigned) version of the "OS-ish" layer.  The "keeper"
of that layer tells me that he could probably do the
port in approx 3 months.  He says that a redesign would
be possible, but less desirable, and (obviously) more
costly (and, therefore, much harder to sell to
management).

I guess my question boils down to this:

   Do I get to decide who's in control of my
   applications, or has Bill Gates decided that for me,
   too?  (why do I have a sneaking suspicion that I
   already know the answer?   ;)

Cheers,
Dave
------------
dksmith@n_o__S_P_A_M__traveller.com
(reply by removing "n_o__S_P_A_M__" from my address)
Sorry for the inconvenience ...
... but the dirtbagcantgetarealjobSPAMMERSmademedoit






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

* Re: Ada in control - Win32 GUI - Possible?
  1997-11-03  0:00 Ada in control - Win32 GUI - Possible? Dave Smith
@ 1997-11-04  0:00 ` Stephen Leake
  1997-11-05  0:00   ` Jerry van Dijk
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Leake @ 1997-11-04  0:00 UTC (permalink / raw)



Dave Smith wrote:
> 
> <snip>
> 
>    Can an Ada program be in control of a Win32 GUI?
> 
> <other stuff snipped about a DLL containing neat stuff, that wants to > be "in control">

Every Win32 application has exactly one message loop that runs all the
windows. Actually, each thread can have a message loop, but things are
MUCH simpler if only one thread has windows. If your DLL can contain a
thread (sorry, task), that manages its resources, there should be no
problem. Or maybe you only need protected objects.

I'm not clear what you mean by "in control". The DLL has an init
procedure called when it is loaded; that does the Ada elaboration. Ada
finalization takes care of cleaning up. What more "control" do you need?
-- 
- Stephe




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

* Re: Ada in control - Win32 GUI - Possible?
  1997-11-04  0:00 ` Stephen Leake
@ 1997-11-05  0:00   ` Jerry van Dijk
  0 siblings, 0 replies; 3+ messages in thread
From: Jerry van Dijk @ 1997-11-05  0:00 UTC (permalink / raw)



In article <345F4B6A.7FDA@gsfc.nasa.gov> Stephen.Leake@gsfc.nasa.gov writes:

>Dave Smith wrote:
>>
>> <snip>
>>
>>    Can an Ada program be in control of a Win32 GUI?
>>

<snip>

>I'm not clear what you mean by "in control". The DLL has an init
>procedure called when it is loaded; that does the Ada elaboration. Ada
>finalization takes care of cleaning up. What more "control" do you need?

As I understand the question:

a) the main program is actually the middleware layer, in Ada, rebuild for W32

b) this main program, when ready, starts the client program in VB

c) the client then wants to use the middleware layer functionality

d) when the client finishes running, the middleware layer gets back
   control and finishes.

e) due to well-known constrains, redesign is not feasible

how to archieve this ?

Unknown is whether there is just one client (and number of instances)
or why (if there is 3 months time) the client isn't also written using
Ada (possibly using an GUI builder).

However, if I am correct in the above, the question has little to do
with Ada. The real question is how to mold an existing application
architecture to fit into the Win32 environment.

Can this be done ? Yes, of course, in a lot of ways. How, that would
depend on a lot of other parameters which are unknown to us.

In general though I would suggest running the middleware layer as a
invisible process, starting the client in the foreground. Communication
by whichever means are most appropiate (lots of choices here). Client
before going down informing the middleware, which will then also
shutdown. Although, as Stephen suggested, running the middleware
from a DLL is also possible, although feasebility would depend on
its current design.

However, there are probably a lot of -to us- unknown complexities and
requirements here, so a specific answer would require a lot more info
and study.

Best advise, if my assumptions are correct, is to call in a application
architect with Ada and Win32 experience.

--

-- Jerry van Dijk | Leiden, Holland
-- Consultant     | Team Ada
-- Ordina Finance | jdijk@acm.org




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

end of thread, other threads:[~1997-11-05  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-11-03  0:00 Ada in control - Win32 GUI - Possible? Dave Smith
1997-11-04  0:00 ` Stephen Leake
1997-11-05  0:00   ` Jerry van Dijk

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