Board index » delphi » ActiveX and WM_QueryEndSession

ActiveX and WM_QueryEndSession

Hi there

I'm using CreateOleObject to get access to another program.
I have no problems closing this program down, when I exit my application,
(Using a Quit function i the program), but when I receive
WM_QUERYENDSESSION, and want to do the same, I get an error message, saying
that I can't send messages because my application is waiting for an
synchronised input.

How do I close objects down I have opened with CreateOleObject when Windows
is shutting down?

Peter Vrist
peter.vr...@npt.dk

 

Re:ActiveX and WM_QueryEndSession


Quote
"Peter Vrist" <p...@npt.dk> wrote in message

news:3b70ecae$0$253$edfadb0f@dspool01.news.tele.dk...

Quote
> Hi there

> I'm using CreateOleObject to get access to another program.
> I have no problems closing this program down, when I exit my application,
> (Using a Quit function i the program), but when I receive
> WM_QUERYENDSESSION, and want to do the same, I get an error message,
saying
> that I can't send messages because my application is waiting for an
> synchronised input.

> How do I close objects down I have opened with CreateOleObject when
Windows
> is shutting down?

Actually you should close this ole application in the OnClose event of the
main form but since you talk about WM_QUERYENDSESSION (I don't know why)
maybe you should try to close it when you receive WM_QUIT or WM_CLOSE
messages which are sent right before WM_QUERYENDSESSION.

Smola

Other Threads