Connecting Tech Pros Worldwide Forums | Help | Site Map

my software prevents windows from shutting down

sanket gupta
Guest
 
Posts: n/a
#1: Nov 15 '05

Hi guys ,
I face a peculiar problem.
I have a mutithreaded software trhat uses sockets to connect to my
webserver.
The problem is that while my software is running , windows is unable to
reboot/logoff or shut down.
I have to shut down the software before windows can do this.
Any suggestions on why this could be happening?
Thanks/Regards
Sanket Gupta




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Christina Androne
Guest
 
Posts: n/a
#2: Nov 15 '05

re: my software prevents windows from shutting down


sanket gupta wrote:
[color=blue]
> The problem is that while my software is running , windows is unable
> to reboot/logoff or shut down.
> I have to shut down the software before windows can do this.
> Any suggestions on why this could be happening?[/color]

I have no idea what can be causing this, but it's damn funny :))).
Anyway, I think you could try to catch the shutdown message and close
all sockets, threads, handles, etc in your handler and then terminate
the application. It's just a wild guess and of course an workarround
not a solution, but could help.

Christina Androne


Christina Androne
Guest
 
Posts: n/a
#3: Nov 15 '05

re: my software prevents windows from shutting down


sanket gupta wrote:
[color=blue]
>
> Hi guys ,
> I face a peculiar problem.
> I have a mutithreaded software trhat uses sockets to connect to my
> webserver.
> The problem is that while my software is running , windows is unable
> to reboot/logoff or shut down.[/color]

Second though: are you having a loop where a socket listens and listens
and listens and never ends?

Christina Androne
Max
Guest
 
Posts: n/a
#4: Nov 15 '05

re: my software prevents windows from shutting down


Your program has to process WM_QUERYSHUTDOWN and WM_SHUTDOWN messages
correctly.

I believe what happens in your case - you answer "yes" on queryshutdown,
system proceeds with shutdown, sends shutdown and your program can not quit
because one of the threads is in some loop or wait function waiting for
messages through socket.
You should think of a mechanism to wake that thread up and tell it to exit
or answer "no" to queryshutdown.
Killing a thread is also an option but not so pretty one.

Search for information about these messages in MSDN.


"sanket gupta" <sanket@tsucorp.net> wrote in message
news:eaiE$aBnDHA.3504@TK2MSFTNGP11.phx.gbl...[color=blue]
>
> Hi guys ,
> I face a peculiar problem.
> I have a mutithreaded software trhat uses sockets to connect to my
> webserver.
> The problem is that while my software is running , windows is unable to
> reboot/logoff or shut down.
> I have to shut down the software before windows can do this.
> Any suggestions on why this could be happening?
> Thanks/Regards
> Sanket Gupta
>
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it![/color]


sanket gupta
Guest
 
Posts: n/a
#5: Nov 15 '05

re: my software prevents windows from shutting down



Thanks guys.
You gave me ahint and rest of the work was done by google whcih gave me
more hints and finally i could solve the problem.
thanks a lot



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Closed Thread