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 X-Google-Thread: 103376,f48da8b15007eae1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-05 10:36:39 PST Message-ID: <3DC80EEA.9090807@cogeco.ca> From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Waiting for callbacks from dll on Win32 References: <3DC806C0.8080307@cogeco.ca> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Date: Tue, 05 Nov 2002 13:33:14 -0500 NNTP-Posting-Host: 198.96.47.195 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1036521194 198.96.47.195 (Tue, 05 Nov 2002 13:33:14 EST) NNTP-Posting-Date: Tue, 05 Nov 2002 13:33:14 EST Organization: Bell Sympatico Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Xref: archiver1.google.com comp.lang.ada:30395 Date: 2002-11-05T13:33:14-05:00 List-Id: Bj�rn Lundin wrote: > Warren W. Gay VE3WWG wrote: >>Stephen Leake wrote: >> >>>Bj�rn Lundin writes: >>> >>>>Hello! >>>>I'm trying to make an interface to a c-dll that >>>>connects to an OPC-server (WTclient.dll) >>>> >>>>It wants a pointer to a procedure, which I can provide >>>>with an access value to a procedure in a protected object. >>> >>> >>>Calling a procedure in a protected object is _not_ the same as calling >>>a "normal" procedure; there are tasking issues involved. >>> >>>Wrap the protected object call in a "normal" procedure, and use that >>>as the callback. >>> >>>Even then, you have to worry about the Ada tasking vs the C tasking. >>>If you have an Ada main, you are probably ok. >> >>I think you also have to keep in mind that DLL tasks are >>separate from your calling environment. So this may >>complicate things depending upon the details. > > I don't quite understand, could you elaborate a bit? > /Bj�rn I have not had personal experience with this yet, but I have read somewhere that DLL tasks run in their own "environment" different from the calling "environment". Ie. if your DLL is an Ada95 DLL, its tasks are separately managed from the calling Ada95 application. If it is not an Ada95 DLL, you can probably ignore this. However, if that DLL creates windows threads, you may have some threading issues. I am not really qualified to expand on this further, since I live mainly in the UNIX world. I would do a Google search on "DLL threads tasks" etc. -- Warren W. Gay VE3WWG http://home.cogeco.ca/~ve3wwg