Click here to Skip to main content
15,918,889 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Shortcut keys - Runtime? Pin
Jose Lamas Rios4-Sep-05 20:20
Jose Lamas Rios4-Sep-05 20:20 
QuestionUnicode Release? Pin
G Haranadh2-Sep-05 23:13
G Haranadh2-Sep-05 23:13 
AnswerRe: Unicode Release? Pin
Michael Dunn2-Sep-05 23:17
sitebuilderMichael Dunn2-Sep-05 23:17 
GeneralRe: Unicode Release? Pin
G Haranadh2-Sep-05 23:24
G Haranadh2-Sep-05 23:24 
General[Msg Deleted] Pin
sunit53-Sep-05 0:21
sunit53-Sep-05 0:21 
GeneralRe: Unicode Release? Pin
G Haranadh3-Sep-05 0:26
G Haranadh3-Sep-05 0:26 
AnswerRe: Unicode Release? Pin
Jose Lamas Rios3-Sep-05 11:23
Jose Lamas Rios3-Sep-05 11:23 
Questionproblem in cutting string Pin
Ankit Aneja2-Sep-05 23:07
Ankit Aneja2-Sep-05 23:07 
i am getting error in following code please help
see the function below
i get date as "Sep-05-2005" which i initially read in smonth
after that take from it smonth as Sep and using switch nmonth as 9
now after taking month and removing it from string -05-2005 is left then
comes day
nday=05
now 05-2005 is left
but when 05 is removed instead of -2005 only -20 is left
this error occurs when first time this function is called on exit
for 2, 3 or ___ no error occurs we get complete -2005
i find this in debug mode

BOOL CXmlData::FnCheckForValidDates(CString szEndDate)
{

//Get Current date
CTime TodayDate=CTime::GetCurrentTime();

int nYear,nMonth,nDay;
CString sMonth;
//date format MM-DD-YYYY

//Extract Month
sMonth=(szEndDate.Left(szEndDate.Find('-')));

//remove the month from String
szEndDate.Replace(szEndDate.Left(szEndDate.Find('-')),""); //-05-2005
//Replace Extra '-'
szEndDate.TrimLeft('-');

//code to get int month from string smonth
if(sMonth == "Jan" )
{
nMonth=1;
}
else if(sMonth == "Feb" )
{
nMonth=2;
}
else if(sMonth == "Mar" )
{
nMonth=3;
}
else if(sMonth == "Apr" )
{
nMonth=4;
}
else if(sMonth == "May" )
{
nMonth=5;
}
else if(sMonth == "Jun" )
{
nMonth=6;
}
else if(sMonth == "Jul" )
{
nMonth=7;
}
else if(sMonth == "Aug" )
{
nMonth=8;
}
else if(sMonth == "Sep" )
{
nMonth=9;
}
else if(sMonth == "Oct" )
{
nMonth=10;
}
else if(sMonth == "Nov" )
{
nMonth=11;
}
else if(sMonth== "Dec")
{
nMonth=12;
}


//Extract Day
nDay=_ttoi(szEndDate.Left(szEndDate.Find('-')));

//remove the day from String//05-2005
szEndDate.Replace(szEndDate.Left(szEndDate.Find('-')),""); but here -20 is left
//Replace Extra '-'
szEndDate.TrimLeft('-');

//Extract year
nYear=_ttoi(szEndDate);

//Expiry date
CTime ExpiryDate(nYear,nMonth,nDay,0,0,0);
//comparison Routine
//first Check year
//comparing todays date with expirey date
if(TodayDate>ExpiryDate)
return FALSE;




#ifdef MYDEBUG
AfxOutputDebugString("Returning True");
#endif




return TRUE;
}

Ankit Aneja

AnswerRe: problem in cutting string Pin
Michael Dunn2-Sep-05 23:14
sitebuilderMichael Dunn2-Sep-05 23:14 
GeneralRe: problem in cutting string Pin
Ankit Aneja2-Sep-05 23:34
Ankit Aneja2-Sep-05 23:34 
AnswerRe: problem in cutting string Pin
ThatsAlok3-Sep-05 0:12
ThatsAlok3-Sep-05 0:12 
GeneralRe: problem in cutting string Pin
Ankit Aneja3-Sep-05 0:46
Ankit Aneja3-Sep-05 0:46 
JokeRe: problem in cutting string Pin
ThatsAlok3-Sep-05 1:50
ThatsAlok3-Sep-05 1:50 
GeneralRe: problem in cutting string Pin
Ankit Aneja3-Sep-05 2:24
Ankit Aneja3-Sep-05 2:24 
GeneralRe: problem in cutting string Pin
Prakash Nadar3-Sep-05 16:02
Prakash Nadar3-Sep-05 16:02 
QuestionHow to use ExecWB method? Pin
Roozbeh692-Sep-05 22:07
professionalRoozbeh692-Sep-05 22:07 
Questionconcept of & Pin
Rupali sarda2-Sep-05 21:55
Rupali sarda2-Sep-05 21:55 
AnswerRe: concept of & Pin
toxcct2-Sep-05 22:48
toxcct2-Sep-05 22:48 
AnswerRe: concept of & Pin
Michael Dunn2-Sep-05 22:53
sitebuilderMichael Dunn2-Sep-05 22:53 
General[Message Deleted] Pin
sunit53-Sep-05 0:17
sunit53-Sep-05 0:17 
GeneralRe: concept of & Pin
sunit53-Sep-05 0:40
sunit53-Sep-05 0:40 
AnswerRe: concept of & Pin
ThatsAlok3-Sep-05 2:27
ThatsAlok3-Sep-05 2:27 
Questionmodeless dialog closing Pin
sayup2-Sep-05 19:51
sayup2-Sep-05 19:51 
AnswerRe: modeless dialog closing Pin
ThatsAlok2-Sep-05 20:49
ThatsAlok2-Sep-05 20:49 
QuestionA fatal error while compiling Pin
ILoveCS2-Sep-05 19:43
ILoveCS2-Sep-05 19:43 

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.