|
If a thread or process terminates, the OS-internal thread/process object is set to signaled state - the state you can use to wait for with e.g. WaitForSingleObject(). So if hThread is your thread handle, the following would wait until the thread has actually terminated:
WaitForSingleObject( hThread, INFINITE )
The point is that you might also use the waiting functions to test if an object (in this case the thread) is in signaled state (in this case has terminated) by just using 0 as the timeout value:
if( WaitForSingleObject( hThread, 0 ) == WAIT_TIMEOUT ) {
// not terminated yet
}
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
Daniel Lohmann wrote: WaitForSingleObject(). So if hThread is your thread handle, the following would wait until the thread has actually terminated:
WaitForSingleObject( hThread, INFINITE )
The point is that you might also use the waiting functions to test if an object (in this case the thread) is in signaled state (in this case has terminated) by just using 0 as the timeout value:
In call of TerminateProcess api, system will close the thread, without releasing any of it memory and related stuff. there might be case the system hang indefinatly at the call of WaitForSingleObject api!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hai,
I need to disable the pushbutton Retrieve on a dialogbox if no item selected in the list.My problem is iam not able to find the dialog box in the resource editor.
Is there any other way to create a dialogbox otherthan resource editor.
|
|
|
|
|
to disable the pushbutton if no item is selected in the list you can do this
m_button.EnableWindow(false);
if you select an item enable the window
m_button.EnableWindow();
For your question on is there any other way.......editor
See Here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
m_button.EnableWindow(false);
if you select an item enable the window
m_button.EnableWindow();
That means i need to disable the button in list control ?
Actually iam not able to find the dialogbox which contains this List and pushbuttons.
I couldnt find it in resource editor ..
Plz help me regarding this.
|
|
|
|
|
You need to disable the button when you are showing the dialog.
Can you tell how are you creating your dialog? (using which API if not in the resource editor)
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
ya this is already released project and it is in the maintenance phase, that too iam new to this project.
so i have searched all dialogboxes in this project through resource editor, But i couldnt find that, so iam thinking that it might be created not by using resource editor.
unless i find the dialogbox i cant do anything, But iam not getting help from anywhere.
Could u help me plz.
|
|
|
|
|
yeah sure. I will try my level best to solve your problem
First search in your code that are you using the CreateDialog() to create the dialog or CreateDialogIndirect()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
iam searching for CreateDialog
|
|
|
|
|
CreateDialog macro creates a modeless dialog box but my dialog is modal dialog.
|
|
|
|
|
Krishnatv wrote: Is there any other way to create a dialogbox otherthan resource editor.
yeah you can create the Dialog box by programming too.. read documentation of CreateDialogIndirect api in MSDN
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
yes see CreateDialogIndirectParam and CreateDialogIndirectParam
whitesky
|
|
|
|
|
WhiteSky wrote: yes see CreateDialogIndirectParam and CreateDialogIndirectParam
Humm!!!!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ThatsAlok wrote: Humm!!!!
but what and why and hi
whitesky
|
|
|
|
|
CreateDialogIndirectParam is for modelless.
But my dialog box is Modal dialog box.
|
|
|
|
|
So see DialogBox and DialogBoxParam
whitesky
|
|
|
|
|
Dear Visual C++ / MFC friends,
How to let the function OnCbnEditchangeCombo1() wait and react until I finish my typing and hit a "Enter" key?
Thanks and regards,
Joy Anne
|
|
|
|
|
This coresponds to which message map :-OnCbnEditchangeCombo1()
I would have sublclassed the editcontrol and overriden the WM_CHAR and checked for Enter and taken the necessary action .
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
i have rich edit contain with scroll how can i print the scroll data from rich edit in dialog base application not sdi or mdi
chetan
|
|
|
|
|
i insert bitmap in richedit after that i want to write text parallel to that bit map but i fail to do that i can write from only last position of the bit map
plaese help
chetan
|
|
|
|
|
I have a big vc6.0 project including lib and dll file, how should I upgrade it from vc6.0 to vc2005? Can you give me some step to do this or good website about that?
Thanks
|
|
|
|
|
|
I created the MFC SDI based application and created one dialog to load two bitmap images
and one custom control derived from MFC class "COleControl" and wrote the flipping implementation
in dialog source file and called the flipping action to be displayed in the custom control.But i faced
one problem while attaching the custom control in the dialog and building the application,the dialog never popsup from popup menu but removing the custom control from the dialog and rebuilding the application, the dialog popsup from menubar.Since i need modal dialog.
Can any one help me??
Quite urgent please help me out...
|
|
|
|
|
I need to know how to communicate with a usb device in c++.
thanks in advance,
Ashok.
Ashok Reddy
|
|
|
|
|
Have u seen this[^] & this[^].
regards,
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|