Skip to main content
gamedev.net
🔒 Locked

Program process not quiting.

Started by cyberben Oct 28, 2000 at 4:08 PM 2 replies 350+ views
Original Post
cyberben
cyberben
Hi there, I''ve been working on an autorun program (You know when you stick in a CD and it pops up a neat little program that introduces you to the CD and let''s you click buttons to do things instead of browse the CD). Anyhow, it''s all going great except when it quits it *closes* the program and it disappears from the task list, but when I run the process viewer (From the C++ dev kit) It''s still in the process list! (This also leaves the EXE locked so I can''t recompile until I restart) Any ideas? Is this a common problem of just not unloading something? The code is way to long to post it all but here''s the run down on what I''m doing: -InitCommonControls -Set up window, etc.. enter message loop -Under WM_CREATE I create the buttons, the fonts used on the button (The buttons are subclassed) and the tooltips. -Under WM_DESTROY I post the quite message -Under WM_COMMAND I check which button was pressed and take the appropriate action. When you click a button it does something (Using ShellExecute) and send a windows message (SC_CLOSE) to myself, to close the program. Any body got any ideas? This is a sort of new problem when I added the tooltips (CommonControls). Thanks, Ben
__________________________Mencken's Law:"For every human problem, there is a neat, simple solution; and it's always wrong."
"Computers in the future may weigh no more than 1.5 tons."- Popular Mechanics, forecasting the relentless march of science in 1949
pUnkOuter
pUnkOuter
i had a problem like this before.. my problem was in calling the message retrieving function ( PeekMessage() ), i was using the hWnd for the window for the HWND parameter, when it should actually be NULL..

if that didn''t make sense....
    
// i did have this:

if(PeekMessage(&msg,hWnd,0,0,PM_REMOVE))
{
.....
}
// and had to change to this:

if(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{ // ^^^^

.....
}


------------------------
IUnknown *pUnkOuter

"Try the best you can
try the best you can
the best you can is good enough"
--Radiohead
------------------------IUnknown *pUnkOuter"Try the best you cantry the best you canthe best you can is good enough" --Radiohead
cyberben
cyberben
Thanks for the ideas! With a little troubleshooting I figured it out, although I haven''t fixed it. I forget to tell you one thing too! When I created all the controls (under WM_CREATE) I set a windows timer, when this timers first timeout occured I would play a sound using mciSendString and kill the timer. The idea behind this is that I want the program to show before it starts playing the sound, because it will be on a CD ROM and will be slow to load. So the timer was set for 1sec, so that it would load and all then they would here the welcome wav file.

Anyhow, you command out this and it doesn''t leave the hidden process. So any idea''s on what to do here? I''ve got one idea but I''m not sure...

Thanks anyhow!
See ya,
Ben
__________________________Mencken's Law:"For every human problem, there is a neat, simple solution; and it's always wrong."
"Computers in the future may weigh no more than 1.5 tons."- Popular Mechanics, forecasting the relentless march of science in 1949

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.