1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

convserion problem

Discussion in 'MFC' started by answerme, Dec 23, 2009.

  1. answerme

    answerme New Member

    Joined:
    Dec 17, 2007
    Messages:
    114
    Likes Received:
    0
    Trophy Points:
    0
    Hi All
    I am getting a error
    Code:
    
    
    strLstItem.Format("%f", latitude);
    //objLstCtrl.SetItemText(nItem, 2, strLstItem);
     objLstCtrl.SetItemText(nItem, 2, latitude);
    
    error C2664: 'CListCtrl::SetItemText' : cannot convert parameter 3 from 'double' to 'LPCTSTR'
    Can anyone solve
     
  2. Gene Poole

    Gene Poole New Member

    Joined:
    Nov 10, 2009
    Messages:
    93
    Likes Received:
    5
    Trophy Points:
    0
    I'm assuming "latiutude" is type float, "strLstItem" is a CString, "objLstCtrl" is a CListCtrl, and UNICODE is off. Given that, you should be calling SetItemText as in your commented out piece. Why is it commented out?
     

Share This Page