Thread: lpctstr problem

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    74

    lpctstr problem

    how to convert integer to lpctstr thanks!
    Last edited by mr_empty; 11-16-2007 at 08:56 PM.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    How do you mean? Perhaps strtol or a stringstream would be the right solution, but it's hard to tell with so little information.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    74
    this command:


    editmessage.SetWindowText(resultCount);

    editmessage is the edit box variable, resultCount is the integer

    but it shows error message that resultCount can't be converted to LPCTSTR

  4. #4
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    itoa()
    sprintf()
    std::stringstream

    There's plenty of ways to convert an int to a char* string.

  5. #5
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    Use a stringstream, then use its str() method to get a string, then use its c_str() method to get a const char* which is what LPCTSTR is (assuming you're not using unicode).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  2. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  3. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  4. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  5. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM