C++ Windows Time in Month, Day, Hour, Time, Seconds and reading files in a directory

DSX
DSX used Ask the Experts™
on
Hi all, this is my first time posting here, but from what I've seen it should be good.

I'm currently creating an online game and I need to run a serverside app created in C++ that at specified times opens all files in a specified directory and does what I tell it.

First off, I'm not really skilled in MFC so I can't use it. I'm just trying to create a console program. I need to know all of the included libraries for it to work.

Basically what I need is three seperate bits of info.
One is how to get the time in seperate variables so that I can read months, days, hours, minutes, and seconds seperately.  I also need it to check for time about every five to ten seconds OR count on it's own and do what I tell it once a certain amount of time has passed.

I also need info on how to get a list of files in a directory, open each one individually, and check off that I've already opened it.

At the end, if you can all help me, I hope to combine it into one app. Thank you all in advance.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
>> how to get the time in seperate variables

http://msdn.microsoft.com/library/en-us/vccore98/HTML/_crt_localtime.asp

>> I also need it to check for time about every five to ten seconds

If you are writing a Win32 application, use timers:
http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/timers.asp
Just make sure you have a message loop in your app.

>>  also need info on how to get a list of files in a directory

FindFirstFile / FindNextFile

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial