Click here to Skip to main content
15,916,457 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: please: codes in number convert in to words Pin
_AnsHUMAN_ 13-Sep-06 17:20
_AnsHUMAN_ 13-Sep-06 17:20 
AnswerRe: please: codes in number convert in to words Pin
Christian Graus13-Sep-06 19:05
protectorChristian Graus13-Sep-06 19:05 
JokeRe: please: codes in number convert in to words Pin
Steve S13-Sep-06 21:37
Steve S13-Sep-06 21:37 
AnswerRe: please: codes in number convert in to words Pin
Hamid_RT13-Sep-06 19:21
Hamid_RT13-Sep-06 19:21 
AnswerRe: please: codes in number convert in to words Pin
David Crow14-Sep-06 3:31
David Crow14-Sep-06 3:31 
QuestionReading details from outlook address book Pin
Steverty13-Sep-06 15:35
Steverty13-Sep-06 15:35 
AnswerRe: Reading details from outlook address book Pin
_AnsHUMAN_ 13-Sep-06 17:26
_AnsHUMAN_ 13-Sep-06 17:26 
QuestionJust how evil is SetTimer and timers in dialogs and when should they be cleaned up? Pin
charlieg13-Sep-06 12:25
charlieg13-Sep-06 12:25 
I have an mfc app that is behaving badly - exhibiting random lockups. It might be the OS, but I don't think so Smile | :) The hang appears to happen when I am leaving a dialog.

I have two styles of leaving a dialog, and based on what I have read in the MS doc, both should be okay. Style 1:

class::OnClickExitBtn()
{
// release all dialog resources.
EndDialog(IDC_EXIT_BTN);
}

Now, in the MS doc, it states that EndDialog sets a flag in the message pump such
that the dialog will exit. Of note is that it will not process any further messages.


Style #2 is:

class::OnClickExitBtn()
{
// All allocated resources in this class released in destructor.
EndDialog(IDC_EXIT_BTN);
}

Style 2 simply moves everything to the destructor. I thought this had cleaned up the hangs, but one just happened again.Mad | :mad:

So, what is the correct exit procedure from a dialog with allocated resources, timers, etc? Any practical experience to shed some light on this? A past project was very suspicious of SetTimer and avoided it like the plague - using a thread to generate an application message....

Thanks for your thoughts...

chg


Charlie Gilley
Will program for food...
Whoever said children were cheaper by the dozen... lied.

My son's PDA is an M249 SAW.
My other son commutes in an M1A2 Abrams

AnswerRe: Just how evil is SetTimer and timers in dialogs and when should they be cleaned up? Pin
Gary R. Wheeler13-Sep-06 15:07
Gary R. Wheeler13-Sep-06 15:07 
GeneralRe: Just how evil is SetTimer and timers in dialogs and when should they be cleaned up? Pin
charlieg13-Sep-06 15:18
charlieg13-Sep-06 15:18 
GeneralRe: Just how evil is SetTimer and timers in dialogs and when should they be cleaned up? Pin
charlieg13-Sep-06 15:23
charlieg13-Sep-06 15:23 
GeneralRe: Just how evil is SetTimer and timers in dialogs and when should they be cleaned up? Pin
Gary R. Wheeler14-Sep-06 1:19
Gary R. Wheeler14-Sep-06 1:19 
GeneralRe: Just how evil is SetTimer and timers in dialogs and when should they be cleaned up? Pin
charlieg14-Sep-06 1:38
charlieg14-Sep-06 1:38 
AnswerRe: Just how evil is SetTimer and timers in dialogs and when should they be cleaned up? Pin
Michael Dunn13-Sep-06 21:18
sitebuilderMichael Dunn13-Sep-06 21:18 
Questionusing *.exe file such az static library Pin
asdf175313-Sep-06 9:25
asdf175313-Sep-06 9:25 
AnswerRe: using *.exe file such az static library Pin
Zac Howland13-Sep-06 9:46
Zac Howland13-Sep-06 9:46 
QuestionOpening a USB keyboard when Windows already has it open? Pin
David Knechtges13-Sep-06 8:29
David Knechtges13-Sep-06 8:29 
QuestionRe: Opening a USB keyboard when Windows already has it open? [modified] Pin
plineaRenade27-Jan-07 10:10
plineaRenade27-Jan-07 10:10 
QuestionMissing Virtual Functions in Properties/Overrides Pin
bob1697213-Sep-06 7:52
bob1697213-Sep-06 7:52 
AnswerRe: Missing Virtual Functions in Properties/Overrides Pin
prasad_som13-Sep-06 19:18
prasad_som13-Sep-06 19:18 
GeneralRe: Missing Virtual Functions in Properties/Overrides Pin
bob1697214-Sep-06 3:21
bob1697214-Sep-06 3:21 
QuestionC++ createProcess wceload on PocketPC [modified] Pin
sMaggi13-Sep-06 6:41
sMaggi13-Sep-06 6:41 
Questionimage as background in ListView Pin
Sigmac13-Sep-06 6:23
Sigmac13-Sep-06 6:23 
AnswerRe: image as background in ListView Pin
Michael Dunn13-Sep-06 7:37
sitebuilderMichael Dunn13-Sep-06 7:37 
GeneralRe: image as background in ListView Pin
Sigmac13-Sep-06 8:45
Sigmac13-Sep-06 8:45 

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.