Click here to Skip to main content
15,908,274 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: File Management Pin
densitet7-Mar-05 23:29
densitet7-Mar-05 23:29 
GeneralRe: File Management Pin
David Crow8-Mar-05 2:16
David Crow8-Mar-05 2:16 
GeneralRe: File Management Pin
densitet8-Mar-05 4:23
densitet8-Mar-05 4:23 
GeneralRe: File Management Pin
David Crow8-Mar-05 4:45
David Crow8-Mar-05 4:45 
Generalcompare current date with listed date Pin
shaans6-Mar-05 21:32
shaans6-Mar-05 21:32 
GeneralRe: compare current date with listed date Pin
ThatsAlok7-Mar-05 2:15
ThatsAlok7-Mar-05 2:15 
GeneralRe: compare current date with listed date Pin
shaans7-Mar-05 16:39
shaans7-Mar-05 16:39 
GeneralRe: compare current date with listed date Pin
ThatsAlok7-Mar-05 18:27
ThatsAlok7-Mar-05 18:27 
here is small code that compare current date with your stored date.
My date Format is YYYY-MM-DD, i Believe,you are smart Enough to modify the code according to your need.
BOOL <You Class>::FnCheckForValidDates(CString szEndDate)
{

	<font color=#008000>//Get Current date</font>
	CTime TodayDate=CTime::GetCurrentTime();

	int nYear,nMonth,nDay;
	<font color=#008000>//date format YYYY-MM-DD</font>

	<font color=#008000>///Extract Year</font>
	nYear=_ttoi(szEndDate.Left(szEndDate.Find('-')));
   
	<font color=#008000>///remove the Year from String</font>
    	szEndDate.Replace(szEndDate.Left(szEndDate.Find('-')),"");
	<font color=#008000>///Replace Extra '-'</font>
		szEndDate.TrimLeft('-');


 <font color=#008000>///Extract Month </font>
		nMonth=_ttoi(szEndDate.Left(szEndDate.Find('-')));
   
	<font color=#008000>///remove the Year from String</font>
    	szEndDate.Replace(szEndDate.Left(szEndDate.Find('-')),"");
	<font color=#008000>///Replace Extra '-'</font>
		szEndDate.TrimLeft('-');

	<font color=#008000>///Extract Day</font>
		nDay=_ttoi(szEndDate);


	<font color=#008000>///comparison Routine</font>
	<font color=#008000>///first Check year</font>

		if(TodayDate.GetYear()>nYear)
			return FALSE;

		if(TodayDate.GetMonth()>nMonth)
			return FALSE;

		if(TodayDate.GetDay()>nDay)
			return FALSE;


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


	

	return TRUE;
}



[Vote One Here, Complete my Survey....]

Alok Gupta
visit me at http://www.thisisalok.tk

         "I Think Believe this Will Help"
Generaltwo digits in edit control Pin
Musen806-Mar-05 20:51
Musen806-Mar-05 20:51 
GeneralRe: two digits in edit control Pin
Cedric Moonen6-Mar-05 21:30
Cedric Moonen6-Mar-05 21:30 
GeneralRe: two digits in edit control Pin
Steen Krogsgaard6-Mar-05 21:39
Steen Krogsgaard6-Mar-05 21:39 
GeneralAutomatic scrolling in ListBox Pin
Majid Shahabfar6-Mar-05 20:40
Majid Shahabfar6-Mar-05 20:40 
GeneralRe: Automatic scrolling in ListBox Pin
V.6-Mar-05 22:26
professionalV.6-Mar-05 22:26 
GeneralRe: Automatic scrolling in ListBox Pin
Majid Shahabfar7-Mar-05 0:56
Majid Shahabfar7-Mar-05 0:56 
GeneralRe: Automatic scrolling in ListBox Pin
V.7-Mar-05 1:18
professionalV.7-Mar-05 1:18 
GeneralRe: Automatic scrolling in ListBox Pin
Jetli Jerry6-Mar-05 23:45
Jetli Jerry6-Mar-05 23:45 
Generalmemory management utilization probz!!!!! Pin
namaskaaram6-Mar-05 19:13
namaskaaram6-Mar-05 19:13 
GeneralRe: memory management utilization probz!!!!! Pin
Bob Stanneveld6-Mar-05 20:24
Bob Stanneveld6-Mar-05 20:24 
GeneralRe: memory management utilization probz!!!!! Pin
namaskaaram6-Mar-05 21:45
namaskaaram6-Mar-05 21:45 
GeneralRe: memory management utilization probz!!!!! Pin
Bob Stanneveld7-Mar-05 20:35
Bob Stanneveld7-Mar-05 20:35 
GeneralRe: memory management utilization probz!!!!! Pin
namaskaaram8-Mar-05 16:32
namaskaaram8-Mar-05 16:32 
GeneralRe: memory management utilization probz!!!!! Pin
David Crow7-Mar-05 10:52
David Crow7-Mar-05 10:52 
GeneralMouse Cursor Hot Spot Pin
User 1026746-Mar-05 16:29
User 1026746-Mar-05 16:29 
GeneralRe: Mouse Cursor Hot Spot Pin
PJ Arends6-Mar-05 16:35
professionalPJ Arends6-Mar-05 16:35 
GeneralMessage Closed Pin
6-Mar-05 16:45
User 1026746-Mar-05 16: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.