From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ba7b74d2699f2def X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-25 03:59:12 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!novia!novia!intgwlon.nntp.telstra.net!news.telstra.net!vicpull1.telstra.net!not-for-mail Message-ID: <3C7A288B.9875C255@chariot.net.au> From: john donoghue X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.7-10 i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: object ada, visual c and tasking combined. References: <3C6CC24D.D013A4AC@chariot.net.au> <3c7780e1.308904750@news.cis.dfn.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Organization: Chariot Internet - http://www.chariot.net.au X-Original-NNTP-Posting-Host: 127.0.0.1 Date: Mon, 25 Feb 2002 22:35:31 +1030 NNTP-Posting-Host: 203.87.95.150 X-Complaints-To: abuse@telstra.net X-Trace: vicpull1.telstra.net 1014638264 203.87.95.150 (Mon, 25 Feb 2002 22:57:44 EST) NNTP-Posting-Date: Mon, 25 Feb 2002 22:57:44 EST Xref: archiver1.google.com comp.lang.ada:20356 Date: 2002-02-25T22:35:31+10:30 List-Id: Nick Roberts wrote: > On Fri, 15 Feb 2002 18:39:49 +1030, john donoghue > 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.