Lisp HUG Maillist Archive

Re: Exiting from a DLL (Windows)

On Thursday, Feb 6, 2003, at 16:18 America/New_York, Nick Levine wrote:

> (Just guessing...)
>
>    Anyway, I have this application which works fine in stand alone (it
>    has an interface etc etc).
>
>    However, when I make it into a DLL, it exhibits the following
>    behavior.
>
>    I call the main function (the entry point of both the stand-alone
>    app and of the DLL) and the interface is brought up with no
>    problems.  Then I can interact with the application.  However
>
>    1 - (Minor point) The "calling application" - some C++ stuff - is
>    frozen in the meanwhile.
>
> Your application made a function call into lisp and is waiting for
> that call to return. What you probably want to do is to spawn off a
> new thread immediately on entry to lisp and allow the calling function
> to return. (Alternatively you could spawn a thread in the C++
> application in which call into lisp, but that looks like much more
> work.)
>

Yep.  I will just spawn a new thread.  The only problem is then to 
catch new calls from the C++ application.  I wouldn't want to respawn 
the whole interface.

>    2 - (Major mess) When I "exit" from the CAPI interface (close the
>    window) the all application is brought down (since I call a QUIT).
>
> There are two ways of generating a DLL: via save-image and using
> Delivery. If your case is save-image then I'm stumped, but imagine
> you're talking about Delivery here. The answer in this case is to set
> the following keyword
>     :quit-when-no-windows nil
>
> Let us know whether you've still got problems!

I generate the DLL using DELIVERY.  I hadn't noticed the 
:QUIT-WHEN-NO-WINDOWS keyword.  I'll try that out.  If it works then it 
will be sweet.

Cheers

--
Marco Antoniotti
NYU Courant Bioinformatics Group		tel. +1 - 212 - 998 3488
715 Broadway 10th FL				fax. +1 - 212 - 998 3484
New York, NY, 10003, U.S.A.


--
Marco Antoniotti
NYU Courant Bioinformatics Group		tel. +1 - 212 - 998 3488
715 Broadway 10th FL				fax. +1 - 212 - 998 3484
New York, NY, 10003, U.S.A.


Updated at: 2020-12-10 09:00 UTC