DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2005
    Posts
    17

    Arrow Clock using C++ & DirectX

    I'm trying to do a clock using the DirectX & C++.
    So I wrote quite everything but now I have a BIG problem, I have to use the system time and apply the hour to the hour hand on the clock and the same for the minute hand.
    I have created a function called SetValue(int valueH, int valueM) that calculates and sets the position on the clock of the hands, but I don't know how can I get the system time.
    Here my control (part of a code):
    Code:
    	static int minute = 0;
    	static int hour = 1;
    	minute++;
    
    	if (minute > 59)
    	{
    		if (hour > 11)
    			hour = 0;
    		hour++;
    		minute = 0;
    	}
    
    	for (i = 0; i < Clock; i++)
    		ClockV.getElement(i)->SetValue(hour, minute);
    By now che hands rotate, but not using the system time!

    Please help me!! :( :(
    Last edited by Arkanops; 04-14-2006 at 09:18 AM.

  2. #2
    Join Date
    Jan 2005
    Location
    UK
    Posts
    604
    Hi,

    try
    CTime timeNow = CTime::GetCurrentTime();
    string nowStr = timeNow.Format("%Y-%m-%d_%H:%M:%S");
    ...

    D

  3. #3
    Join Date
    Jul 2005
    Posts
    17
    Not usable with DirectX

  4. #4
    Join Date
    Jul 2005
    Posts
    17
    Problem fixed!!
    Last edited by Arkanops; 04-14-2006 at 09:59 AM.

Similar Threads

  1. Voice Recording w DirectX
    By system.drawing in forum VB Classic
    Replies: 0
    Last Post: 08-03-2005, 11:50 PM
  2. PC CLOCK SYNCHRONIZING USING VISUAL BASIC
    By Al Rest in forum vb.announcements
    Replies: 0
    Last Post: 06-10-2002, 03:19 AM
  3. DirectX and .NET?
    By Calvin in forum .NET
    Replies: 2
    Last Post: 10-19-2001, 12:43 AM
  4. Replies: 0
    Last Post: 08-12-2000, 12:34 PM
  5. drwas a clock
    By zainorin in forum Java
    Replies: 0
    Last Post: 08-01-2000, 09:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links