Discussion Board

Results 1 to 4 of 4
  1. #1
    Super Contributor chandran.biju007's Avatar
    Join Date
    Nov 2008
    Posts
    675
    Hi,
    I have created a Setting List in my application following the link
    http://wiki.forum.nokia.com/index.php/Settings_Lists

    I have a Time editor in the Setting List.

    Once the time is set in the setting list,my app performs a comparison between the set time and current time.
    Say the time set was 3.52 PM
    The comparison is done as follows:-
    Code:
     TTime now;
    	 TTime settingTime;
    	 settingTime = iSleepSettingsData->SettingTime();
    	 now.HomeTime();
    	 HBufC* timeFormatString = NULL;
    	 TBuf<50> timeString;
    	 timeFormatString = CEikonEnv::Static()->
    	                AllocReadResourceLC(R_QTN_TIME_USUAL);
    	 
    	 now.FormatL(timeString,*timeFormatString);
    	 RDebug::Printf("Present time:");
    	 RDebug::Print(timeString);
    	 
    	 settingTime.FormatL(timeString,*timeFormatString);
    	 RDebug::Printf("Setting time:");
    	 RDebug::Print(timeString);
    	 TTimeIntervalHours minDiff;
    	 now.HoursFrom(settingTime, minDiff);
    	 RDebug::Print(_L("Current time is %d hours ahead from set time ////////////////////////////"),minDiff.Int());
    	 if(now.operator ==(settingTime)){
    
               RDebug::Printf("The comparison succeeded");
             }else{
               RDebug::Printf("The comparison failed");
             }
    The output is as follows:-

    Present time:
    5:57 pm
    Setting time:
    3:52 pm
    Current time is 17619842 hours ahead from set time ////////////////////////////
    The comparison failed

    Kindly someone please tell me why it gives such an absurd number of hours when the difference is just 2.
    Should i convert the TTime received from the setting list to some other format.What is being done wrong...
    Plz Help!!!

    Regards
    Biju Chandran

  2. #2
    Registered User kamalakshan's Avatar
    Join Date
    Jun 2007
    Location
    Mumbai, India
    Posts
    1,998
    Have you tested it on real device. It should work fine on the device.

  3. #3
    Super Contributor chandran.biju007's Avatar
    Join Date
    Nov 2008
    Posts
    675
    No it doesnt work on the real device as well..
    When a supply the settingTime to an RTimer this way
    Code:
    iTimer->At(settingTime));
    Then the callback method of the notifier of the timer AO,registers an error with error code -10.
    Code:
    void CAppUi::TimerExpired(TAny* aTimer,TInt aError)
    	{
    	if(aError == KErrNone)
    	  {
    	  // Timer successfully completed, handle it
    	  ShowInfoL(_L("Timer Expired"));
    	  }
    	}
    aError is -10.

    Error code -10 is
    In the context of mathematical or time/date functions, indicates a calculation that has produced a result smaller than the smallest magnitude of a finite number allowed by the representation.

    When i print the settingTime as explained in the previous post it prints it proper.
    What is it that i should do to give the setting time as input to the RTimer.Is any intermediate conversion needed????

  4. #4
    Super Contributor chandran.biju007's Avatar
    Join Date
    Nov 2008
    Posts
    675
    Has no one experienced this before.
    Champions please share your experience.....

Similar Threads

  1. Cannot create sis package?
    By gomcoite in forum Themes/Carbide.ui
    Replies: 4
    Last Post: 2008-09-27, 17:54
  2. Error in packaging process :(
    By a-eqla3 in forum Themes/Carbide.ui
    Replies: 2
    Last Post: 2008-07-30, 22:03
  3. Error in packaging process :(
    By a-eqla3 in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2008-07-24, 20:33
  4. ERROR IN CREATING THEME
    By ssmantri in forum Themes/Carbide.ui
    Replies: 5
    Last Post: 2008-05-29, 20:58
  5. How to activate another view on selection of Setting List item
    By rahulm in forum Symbian User Interface
    Replies: 2
    Last Post: 2007-09-03, 01:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved