Hello,
I am writting a program in MFC. I was needing to know how do I make it so the program stops working after 30 days?
Thank You In Advance,
Daniel
Printable View
Hello,
I am writting a program in MFC. I was needing to know how do I make it so the program stops working after 30 days?
Thank You In Advance,
Daniel
There's no one way to do it.. there are many ways I can think of. How about, create a CTime variable, Call CTime::GetDay and record it in a file in the windows directory or the registry IF the file or key doesn't already exist. If it does exist, call CTime::GetDay and compare it to the value in the file.
Refer to MSDN: http://msdn.microsoft.com/library/de...a3a.GetDay.asp for description and uses of CTime
I've done something like this before. I just learned how to read/write from/to Windows™ registry. I just kept the day information in a registry key.
Registry keys can be read and altered. Use names that seem unconnected with your program, and use just numbers, not obvious date/times. Another popular trick is to store the information in a file and call the file something annoymous.dll and stick it in the Windows directory.
There are ways around most of the simple methods.