Click here to Skip to main content
16,015,072 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionFind the specified string and increment Pin
manju#1238-May-08 20:36
manju#1238-May-08 20:36 
AnswerRe: Find the specified string and increment Pin
Nitheesh George8-May-08 21:19
Nitheesh George8-May-08 21:19 
GeneralRe: Find the specified string and increment Pin
manju#1238-May-08 23:08
manju#1238-May-08 23:08 
AnswerRe: Find the specified string and increment Pin
Nitheesh George8-May-08 21:28
Nitheesh George8-May-08 21:28 
GeneralRe: Find the specified string and increment Pin
manju#1238-May-08 23:34
manju#1238-May-08 23:34 
QuestionIs there any method to check for a valid hwnd from an another thread? Pin
namaskaaram8-May-08 19:44
namaskaaram8-May-08 19:44 
AnswerRe: Is there any method to check for a valid hwnd from an another thread? Pin
Stephen Hewitt8-May-08 19:52
Stephen Hewitt8-May-08 19:52 
AnswerRe: Is there any method to check for a valid hwnd from an another thread? Pin
asrelu10-May-08 22:52
asrelu10-May-08 22:52 
If the target window is a top level window you can install a hook (see WH_SHELL) to be notified about destroying top level windows.

But frankly, no matter what technique you use, you can be never sure. If everything looks ok and you send a message to that window, the window still can be destroyed in the same moment(almost the same). Or while is processing your message. Simply there is no way to prevent a foreign window from beeing destroyed anytime.

The only thing you can do is to implement thoroughful error processing, verify the effects of each of the messages sent and check regularly if the handle is still for the same window and not reused for another one.

Working with a foreign windows is something similar to working with dialog boxes. You can never be sure what stupidity will a user type in an edit box so you have to check everything.

I think a window beeing destroyed exactly in the very moment when you need it, is a very rare occurence. Just make sure to limit to minimum the damages of such an event. If your software stops abruptly and hours of the user's unsaved work are gone, that's unacceptable. If the only thing that happens is an error message "Internal error, please repeat the last command", that's acceptable, even if it's not desirable. Even the best software fails sometimes. The only question is how it fails: disastruously or gracefully ?
QuestionHow to Save Text File in SDI application Pin
phanindra varma8-May-08 19:05
phanindra varma8-May-08 19:05 
QuestionRe: How to Save Text File in SDI application PinPopular
Rajesh R Subramanian8-May-08 19:20
professionalRajesh R Subramanian8-May-08 19:20 
GeneralRe: How to Save Text File in SDI application Pin
Rajkumar R8-May-08 20:07
Rajkumar R8-May-08 20:07 
GeneralRe: How to Save Text File in SDI application Pin
Hamid_RT8-May-08 20:34
Hamid_RT8-May-08 20:34 
GeneralRe: How to Save Text File in SDI application Pin
Rajesh R Subramanian8-May-08 20:36
professionalRajesh R Subramanian8-May-08 20:36 
GeneralRe: How to Save Text File in SDI application Pin
Rajkumar R8-May-08 21:05
Rajkumar R8-May-08 21:05 
AnswerRe: How to Save Text File in SDI application Pin
Nitheesh George8-May-08 19:38
Nitheesh George8-May-08 19:38 
AnswerRe: How to Save Text File in SDI application Pin
Rajkumar R8-May-08 20:22
Rajkumar R8-May-08 20:22 
GeneralRe: How to Save Text File in SDI application Pin
phanindra varma9-May-08 1:13
phanindra varma9-May-08 1:13 
GeneralRe: How to Save Text File in SDI application Pin
Rajkumar R9-May-08 4:08
Rajkumar R9-May-08 4:08 
AnswerRe: How to Save Text File in SDI application [modified] Pin
asrelu10-May-08 23:29
asrelu10-May-08 23:29 
QuestionHow to Disable Menu item in SDI application Pin
phanindra varma8-May-08 19:02
phanindra varma8-May-08 19:02 
AnswerRe: How to Disable Menu item in SDI application Pin
Nibu babu thomas8-May-08 19:09
Nibu babu thomas8-May-08 19:09 
AnswerRe: How to Disable Menu item in SDI application Pin
Mukesh Kumar8-May-08 19:15
Mukesh Kumar8-May-08 19:15 
GeneralRe: How to Disable Menu item in SDI application Pin
phanindra varma9-May-08 1:07
phanindra varma9-May-08 1:07 
GeneralRe: How to Disable Menu item in SDI application Pin
phanindra varma9-May-08 20:24
phanindra varma9-May-08 20:24 
QuestionTree Collapsing if i delete any node of the Tree. Pin
Royaltvk8-May-08 18:46
Royaltvk8-May-08 18:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.