Thread: 30 Day Trial

  1. #1
    Daniel
    Guest

    30 Day Trial

    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

  2. #2
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802
    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

  3. #3
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Post Suggestion

    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.
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: [email protected]

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  4. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    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.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Constructive criticism/suggestions
    By LineOFire in forum C Programming
    Replies: 11
    Last Post: 09-30-2006, 09:32 AM
  2. Boom, Headoshot!!
    By mrafcho001 in forum A Brief History of Cprogramming.com
    Replies: 50
    Last Post: 07-21-2005, 08:28 PM
  3. debug program
    By new_c in forum C Programming
    Replies: 3
    Last Post: 03-18-2002, 11:50 PM
  4. software 30 day trial code/name-> sn code
    By Dummies102 in forum C++ Programming
    Replies: 3
    Last Post: 02-16-2002, 08:45 PM
  5. Simplified code
    By soonerfan in forum C Programming
    Replies: 2
    Last Post: 12-05-2001, 03:50 PM