×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    19

    TBuf<32>' to 'int'

    Hi ,
    I am getting error for TBuf
    Any solution?

    I declared as ---
    const TInt KMaxTelephoneNumber = 32;

    const CLogEvent& event = iRecentView->Event();

    TTimeIntervalSeconds timeInSeconds = event.Duration();
    iDuration = timeInSeconds.Int();


    iTelephoneNumber = event.Number();

    CAknInformationNote *telnum = new(ELeave) CAknInformationNote;
    TBuf<20> numberbuf;
    numberbuf.Num(iTelephoneNumber);-------------error
    telnum->ExecuteLD(numberbuf);



    error is:::::::
    error C2664: 'void __thiscall TDes16::Num(int)' : cannot convert parameter 1 from 'class TBuf<32>' to 'int'



    thanks in advance...

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: TBuf<32>' to 'int'

    just use Copy there, not Num.

    Also why don't you use this buffer directly on the notedialog, no point on copying it to another buffer before showing. Also are you sure it is safe to copy buffer that can be 32 characters long to a buffer with maximum lenght of 20.

    yucca

  3. #3
    Regular Contributor
    Join Date
    Oct 2004
    Location
    india
    Posts
    306

    Re: TBuf<32>' to 'int'

    use TLex

    to covert buf to integer

  4. #4
    Registered User
    Join Date
    Oct 2005
    Posts
    19

    Re: TBuf<32>' to 'int' hi yucca ..urgent...

    Hi friends,

    I my code number, duration and cost of a call should display after ending the call.
    For this code it is overlapping ..so it is not displaying anything...
    can anyone make it....


    void CCallLog::RunL()
    {
    RWsSession WsSession;
    WsSession.Connect();
    TApaTaskList taskList(WsSession);
    TApaTask task = taskList.FindApp(KAppName);
    task.BringToForeground();

    /*TInt CCallLog::TimerCallback(TAny* aArgument)
    {
    CCallLog* pThis = (CCallLog*)aArgument;

    }*/

    const CLogEvent& event = iRecentView->Event();

    TTimeIntervalSeconds timeInSeconds = event.Duration();
    iDuration = timeInSeconds.Int();


    iTelephoneNumber = event.Number();


    iUnit = ( iDuration / 60 ) + 1 ;
    iRate = 5.00 * iUnit;
    /*
    TBuf<20> iTempSize;
    _LIT(message,"Number : %d ");
    iTempSize.Format(message,iTelephoneNumber);
    */
    TBuf<20> iTempSize1;
    _LIT(message1,"Duration : %d Secs");
    iTempSize1.Format(message1,iDuration);

    TBuf<20> iTempSize2;
    _LIT(message2,"Cost : Rs. %d ");
    iTempSize2.Format(message2,iRate);



    // iTelNumber.Copy(event.Number());


    // CAknInformationNote *telnum = new(ELeave) CAknInformationNote;
    //TBuf<20> numberbuf;
    // numberbuf.Num(iTelephoneNumber);
    // telnum->ExecuteLD(iTelephoneNumber);

    CAknInformationNote *teldur = new(ELeave) CAknInformationNote;
    TBuf<20> durationbuf;
    durationbuf.Num(iDuration);
    teldur->ExecuteLD(durationbuf);

    CAknInformationNote *telrate = new(ELeave) CAknInformationNote;
    TBuf<20> ratebuf;
    ratebuf.Num(iRate);
    telrate->ExecuteLD(ratebuf);

    Cancel();

    }

Similar Threads

  1. Why Are Pre-processors Inherently Evil?
    By grahamhughes in forum Mobile Java General
    Replies: 15
    Last Post: 2009-02-12, 08:42
  2. another Null pointer exception
    By kvchen1985 in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2004-06-28, 15:33
  3. Firmware bug or code bug displaying list on 3650
    By blackjack75 in forum Mobile Java General
    Replies: 2
    Last Post: 2003-09-24, 19:52
  4. Animated gif, or multiple png's ...
    By Dark16 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2003-05-07, 10:39
  5. some problems with label
    By vivienzhung in forum Mobile Java General
    Replies: 1
    Last Post: 2002-10-21, 09:52

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×