Click here to Skip to main content
15,922,007 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to create environment variables in run-time ? ? Pin
Hamid_RT11-Jul-07 20:19
Hamid_RT11-Jul-07 20:19 
AnswerRe: How to create environment variables in run-time ? ? Pin
Cvaji11-Jul-07 21:06
Cvaji11-Jul-07 21:06 
QuestionCListCtrl could not show icon sometimes. Pin
CooperWu11-Jul-07 19:44
CooperWu11-Jul-07 19:44 
AnswerRe: CListCtrl could not show icon sometimes. Pin
Hamid_RT11-Jul-07 19:58
Hamid_RT11-Jul-07 19:58 
GeneralRe: CListCtrl could not show icon sometimes. Pin
CooperWu11-Jul-07 20:26
CooperWu11-Jul-07 20:26 
GeneralRe: CListCtrl could not show icon sometimes. Pin
Mark Salsbery12-Jul-07 6:09
Mark Salsbery12-Jul-07 6:09 
GeneralRe: CListCtrl could not show icon sometimes. Pin
CooperWu12-Jul-07 15:18
CooperWu12-Jul-07 15:18 
QuestionHelp file .hpj Error Pin
sridharsb200711-Jul-07 18:49
sridharsb200711-Jul-07 18:49 
QuestionCD - DVD Writing Pin
ragavan11-Jul-07 18:21
ragavan11-Jul-07 18:21 
AnswerRe: CD - DVD Writing Pin
David Crow12-Jul-07 2:42
David Crow12-Jul-07 2:42 
Questiondocument view and dialog Pin
saisp11-Jul-07 17:49
saisp11-Jul-07 17:49 
AnswerRe: document view and dialog Pin
DevMentor.org11-Jul-07 18:51
DevMentor.org11-Jul-07 18:51 
GeneralRe: document view and dialog Pin
saisp11-Jul-07 19:07
saisp11-Jul-07 19:07 
GeneralRe: document view and dialog Pin
DevMentor.org11-Jul-07 23:29
DevMentor.org11-Jul-07 23:29 
GeneralRe: document view and dialog Pin
saisp11-Jul-07 23:43
saisp11-Jul-07 23:43 
GeneralRe: document view and dialog Pin
DevMentor.org12-Jul-07 0:55
DevMentor.org12-Jul-07 0:55 
GeneralRe: document view and dialog Pin
DevMentor.org12-Jul-07 1:02
DevMentor.org12-Jul-07 1:02 
GeneralRe: document view and dialog Pin
saisp12-Jul-07 1:15
saisp12-Jul-07 1:15 
GeneralRe: document view and dialog Pin
DevMentor.org12-Jul-07 2:23
DevMentor.org12-Jul-07 2:23 
GeneralRe: document view and dialog Pin
saisp12-Jul-07 2:34
saisp12-Jul-07 2:34 
GeneralRe: document view and dialog Pin
DevMentor.org12-Jul-07 9:32
DevMentor.org12-Jul-07 9:32 
QuestionThe ActiveX Control embeded in Web Pin
eraccn11-Jul-07 16:08
eraccn11-Jul-07 16:08 
AnswerRe: The ActiveX Control embeded in Web Pin
LoveCPlusplus18-Jul-07 0:39
LoveCPlusplus18-Jul-07 0:39 
GeneralRe: The ActiveX Control embeded in Web Pin
eraccn18-Jul-07 3:33
eraccn18-Jul-07 3:33 
QuestionCheckDlgButton() not unchecking sometimes Pin
cfo5ter11-Jul-07 15:31
cfo5ter11-Jul-07 15:31 
I have several places in my application where I am trying to change multiple GUI objects in the same function. Not all of the changes are actually taking. For instance in the below snip, the 1st SetWindowText() does not always get written, even when the MyDialer.Hangup takes a while (which it often does, it hangs up a RAS connection). The CheckDlgButton seems never to get called because this checkmark persists (it worked at one point until I moved the ::KillTimer() to before the Hangup).

There are other places in my code where I SetWindowText() before calling a lengthy function and then set it again after that function but before calling the next lengthy function and SOMETIMES the second update works and sometimes it doesn't.

I have the feeling that this is one of those things that experienced programmers just know about and how to work around and that's why it's hard to find a doc or write up on it. I also have a feeling it has to do with my stubborn lack of use of the "UpdateData( FALSE );" method. If someone tells me that using that darn thing exclusively will definitely make these objects update every time, I'll change my code ALL around. I'll still wonder very much why these other direct functions don't force the update properly, but I'll change.

note: none of my function calls are multi-threaded so if passing of control of the only thread to another function is affecting this, I thought I'd let you all know that up front. I also am still running VC 6.0 and the PSDK that was last released that supported 6.0 (for the stupid little apps that my company asks me to write they won't spring for a newer V Studio).

m_objInfoWindowLineOne is a CEdit object for one of my text boxes.
IDC_CHECK_TIMEOUT_OVERRIDE is one of my checkboxes.

void CTstDlg::OnButtonHangUp() <br />
{<br />
	m_objInfoWindowLineOne.Clear();<br />
	m_objInfoWindowLineOne.SetWindowText("Disconnecting");<br />
	<br />
	::KillTimer(GetSafeHwnd(), IDT_DIALTIMER);<br />
	MyDialer.Hangup();<br />
	CheckDlgButton(IDC_CHECK_TIMEOUT_OVERRIDE, BST_UNCHECKED);<br />
	<br />
	m_objInfoWindowLineOne.Clear();<br />
	m_objInfoWindowLineOne.SetWindowText("Idle");<br />
	<br />
	m_strIPAddress.Empty();<br />
	UpdateData( FALSE );<br />
	<br />
	MySQLConnection.WriteDialupLogDisconnect();<br />
}


Thank you unendingly for any light you can shed,
Chuck

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.