How to change __int64 to a CString

Posted on 2006-04-26
Last Modified: 2008-03-17
Hi Experts,

I want to set a Editbox in a dialog box to a __int64 value.
How can I change this to a CString?

CEdit editbox;
__int64 tempVal = 123456789;
editBox.SetWindowText( ?);

Question by:thanesh
    LVL 8

    Expert Comment

    printf("%I64", i64Val)
    LVL 8

    Expert Comment

    Sorry it should be:
    printf("%I64d", i64Val)
    LVL 86

    Accepted Solution

    Actually, that should be

    CEdit editbox;
    __int64 tempVal = 123456789;
    CString text;
    editBox.SetWindowText( text);
    LVL 8

    Assisted Solution

    In you case it may be:
    CString strText;
    strText.Format("%I64d",  tempVal);

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
    C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (…
    The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
    The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now