1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

How To Convert From double to LPCTSTR

Discussion in 'MFC' started by nutty boy, Apr 19, 2007.

  1. nutty boy

    nutty boy New Member

    Hi Guys
    I have wrote a VC++ program using MS_Visual Studio 2005 as single document interface and i difined a variable m_r1 as double,and i want to display the value of this varible on the screen
    so i wrote this code in the On_Draw function of the view class


    but when i compiled the program i get an error message
    error C2664:'BOOL CDC::TextOutA(int,int,LPCTSTR,int)':cannot convert parameter 3 from 'double' to 'LPCTSTR'

    pls how to overcome this problem and what can i do to display any type of variable on the screen "the only working one is of type CString"
  2. shabbir

    shabbir Administrator Staff Member

    Simple. Just do the following.
    CString str;
  3. nutty boy

    nutty boy New Member

    thanks very much it works fine
  4. shabbir

    shabbir Administrator Staff Member


Share This Page