Click here to Skip to main content
15,919,479 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Unicode Clipboard Pin
Tim Deveaux30-May-01 7:36
Tim Deveaux30-May-01 7:36 
GeneralRe: Unicode Clipboard Pin
30-May-01 13:22
suss30-May-01 13:22 
GeneralImporting existing Dialog interfaces into a new SDI application. Pin
Kimball M. Rudeen29-May-01 13:05
Kimball M. Rudeen29-May-01 13:05 
GeneralRe: Importing existing Dialog interfaces into a new SDI application. Pin
Christian Graus29-May-01 13:12
protectorChristian Graus29-May-01 13:12 
GeneralTimer in a Dialog Box Pin
RobJones29-May-01 12:54
RobJones29-May-01 12:54 
GeneralRe: Timer in a Dialog Box Pin
Christian Graus29-May-01 13:07
protectorChristian Graus29-May-01 13:07 
GeneralRe: Timer in a Dialog Box Pin
RobJones29-May-01 13:30
RobJones29-May-01 13:30 
GeneralRe: Timer in a Dialog Box Pin
Christian Graus29-May-01 13:47
protectorChristian Graus29-May-01 13:47 
> Thanks, I put the UpdateData(TRUE); at the top of this. I have tried several different ways of Checking the timer
>variable for the value I want but none seem to trigger the event.. I assume I have to compare the m_strTimer2 CString
>to a CString variable.. here is just one of the ways I have tried.. (Don't laugh.. I'm new at this)

Don't worry - I almost never laugh ( I was once new at this, too Smile | :) )

Here is a portion of the code...
.
.
.
case IDC_TIMER2:
//Increment the count
m_iCount--;
//format and display the count
m_timer2.Display(m_iCount,iM,iH,iD,(CString)m_strTimer2="%D:%H:%M:%S");
break;
}
if(m_strTimer2 == "55") // Which I believe is 55 seconds..
{
MessageBox("15 Seconds");
}
UpdateData(FALSE);

CDialog::OnTimer(nIDEvent);
}

Why compare the string ? It's never going to *equal* 55, if it's formated to include other characters like ':'. You need in the least to say

if (m_StrTimer2.Left(2) == "55")

and I would tend to ignore the formatted string and do comparisons on the integers you used to format the string in the first place.


Christian

#include "std_disclaimer.h"

People who love sausage and respect the law should never watch either one being made.

The things that come to those who wait are usually the things left by those who got there first.

GeneralRe: Timer in a Dialog Box Pin
29-May-01 14:43
suss29-May-01 14:43 
GeneralRe: Timer in a Dialog Box Pin
Christian Graus29-May-01 14:53
protectorChristian Graus29-May-01 14:53 
GeneralRe: Timer in a Dialog Box Pin
RobJones30-May-01 6:03
RobJones30-May-01 6:03 
GeneralRe: Timer in a Dialog Box Pin
RobJones30-May-01 8:53
RobJones30-May-01 8:53 
General"Preloading" a driver Pin
29-May-01 12:12
suss29-May-01 12:12 
General'default' button Pin
29-May-01 11:03
suss29-May-01 11:03 
GeneralRe: 'default' button Pin
Hesham Desouky29-May-01 20:26
Hesham Desouky29-May-01 20:26 
GeneralMFC custom control with child Pin
Kayan29-May-01 10:17
Kayan29-May-01 10:17 
GeneralRe: MFC custom control with child Pin
Michael A Barnhart30-May-01 12:02
Michael A Barnhart30-May-01 12:02 
GeneralMFC MDI 2nd main window problem Pin
Peter Jones29-May-01 10:07
Peter Jones29-May-01 10:07 
GeneralExplorer does not load shell extension.. Pin
J Patel29-May-01 9:06
J Patel29-May-01 9:06 
GeneralRe: Explorer does not load shell extension.. Pin
Michael Dunn29-May-01 9:38
sitebuilderMichael Dunn29-May-01 9:38 
GeneralRe: Explorer does not load shell extension.. Pin
J Patel29-May-01 9:47
J Patel29-May-01 9:47 
GeneralWebBrowser document Automation capabilities. Pin
Alex Chmakotine29-May-01 8:15
Alex Chmakotine29-May-01 8:15 
GeneralDialog to Doc or Dialog to View update Pin
29-May-01 7:39
suss29-May-01 7:39 
GeneralRe: Dialog to Doc or Dialog to View update Pin
Christian Graus29-May-01 13:16
protectorChristian Graus29-May-01 13:16 
GeneralGetting links in Internet Explorer Pin
Crocmort29-May-01 6:44
Crocmort29-May-01 6:44 

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.