comp.lang.ada
 help / color / mirror / Atom feed
From: john donoghue <donoghue@chariot.net.au>
Subject: Re: object ada, visual c and tasking combined.
Date: Mon, 25 Feb 2002 22:35:31 +1030
Date: 2002-02-25T22:35:31+10:30	[thread overview]
Message-ID: <3C7A288B.9875C255@chariot.net.au> (raw)
In-Reply-To: 3c7780e1.308904750@news.cis.dfn.de

Nick Roberts wrote:

> On Fri, 15 Feb 2002 18:39:49 +1030, john donoghue <donoghue@chariot.net.au>
> strongly typed:
>
> >...
> >... It seems to work ... next problem .... The visual c windowing stuff
> >is in its own task, and there is also another C task that needs to wait
> >on an ada function to return with data - but everytime I call the
> >"pointered" functions from these tasks the app spits the dummy (
> >terminates with a exception that provides no name or message or
> >anything. )
> >I am guessing that you cant call the ada functions from the other C
> >tasks since they are in other tasks to the ada functions :) ... but is
> >there a way around it?
>
> What do you mean by "another C task"? Do you mean a Windows thread, or do
> you mean a separate process (as in execXX etc.)? In either case (as best I
> recall) Windows, since threads permit options regarding memory sharing (and
> your Ada may take advantage of these options), I suspect the cross-'task'
> calls fail because they cause code to try to access memory that it it is
> not permitted to.
>
> You may hate this suggestion, but my suggestion to you would be to
> modularise your application at a different (higher) level, e.g. COM.
>
> You could make your Ada 'engine' into a stand-alone program whch is a COM
> server, and the VC front-end into a COM client. I am no expert on Windows
> COM, but I think the stuff on AdaPower should give you most of what you
> need to do it. I think in the end you'd find this to be a better solution.
>
> Best of luck!
> --
> Nick Roberts

The C task was a windows thread.
The data beging passed around could have been anything - it didnt matter even
if I never used the value being passed in. Just calling the ada code from
another windows task caused problems.

I gave up on MFC and am using some c++ classes I have written previously that
use just the basic win32.
These dont have any tasks created for messages pumps or anything, and so
allows me to create a task in ADA that processes the message loop and allows
me to keep all tasks as ada ones.
... no more unknown application closing now :)

Thanks all.




  reply	other threads:[~2002-02-25 12:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-15  8:09 object ada, visual c and tasking combined john donoghue
2002-02-15 18:06 ` Stephen Leake
2002-02-15 18:34   ` tmoran
2002-02-15 20:29     ` john donoghue
2002-02-16  4:14 ` Steve Doiel
2002-02-23 13:36 ` Nick Roberts
2002-02-25 12:05   ` john donoghue [this message]
2002-02-25 13:20     ` Frank J. Lhota
2002-02-25 20:10     ` Randy Brukardt
2002-02-27 20:53       ` john donoghue
replies disabled

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