• 0

[C++]getting windows uptime information in days,hours,etc?


Question

3 answers to this question

Recommended Posts

  • 0

Most times I use groups.google for infos like this.

I tried it and found this:

hrup = GetTickCount / 1000 / 60 / 60 'Hours

minup = GetTickCount / 1000 / 60 'Minutes

secup = GetTickCount / 1000 'Seconds

I think there must be another way because gettickcount will wrap when the uptime is more than 47 days. But if that does not bother you, gettickcount should be a good solution.

For details on each windows function you should also consider reading msdn.microsoft.com :)

  • 0

Thanks. One more thing, How would I go about easily making my program a graphical program inside Visual Studio .NET 2003 with C++ and making my project load with the GUI, im not a big fan of command line...

  • 0

Well you could use MFC, WFC, WinForms, or just straight Win32. :ninja: These are all MS technologies; there are others, but they're generally only used when portability is an issue.

As for which one you should go for, well, it depends. WinForms is the newest, and by far the easiest to learn and use, but requires the .NET framework to be installed for people to be able to run your app. MFC is up to version 7, and is showing its age, but otherwise is a good choice, supporting a wide range of features. WFC is also a good choice, being more modern than MFC and thus better designed, but lacks support from MS (AFAIK). Win32 is the underlying Windows API - huge, powerful, old, non-OO, requires significant investment of time to do even the most trivial of things ( :dead: ); not recommended for writing GUIs.

If you want the absolute easiest way to write GUI apps, consider switching to C# (included with Visual Studio .NET). Then you can use the excellent Visual Studio forms designer (which I'm pretty sure doesn't support C++) to quickly write GUI apps based on WinForms.

Hope this helps :)

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.