Putting text into an edit box

This is a discussion on Putting text into an edit box within the Windows Programming forums, part of the Platform Specific Boards category; I have an edit box created, how do I add text to it? I want to use strings (from strings.h)....

  1. #1
    eam
    eam is offline
    Registered User eam's Avatar
    Join Date
    Oct 2003
    Posts
    53

    Putting text into an edit box

    I have an edit box created, how do I add text to it? I want to use strings (from strings.h).

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,642
    Send it the WM_SETTEXT message.

    gg

  3. #3
    eam
    eam is offline
    Registered User eam's Avatar
    Join Date
    Oct 2003
    Posts
    53
    What should I put for wParam?

    and.. I go this error trying to use a string as lParam:

    error C2440: 'type cast' : cannot convert from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'long'

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,642
    wParam is not used (like the help says). Put 0 or whatever you want.

    The string class does not come from strings.h, it comes from <string> and you want to use the "c_str()" method to get a pointer to a C string.

    gg

  5. #5
    eam
    eam is offline
    Registered User eam's Avatar
    Join Date
    Oct 2003
    Posts
    53
    error C2065: 'c_str' : undeclared identifier

    I probably did it wrong :/. Can you give me an example of using it please?

  6. #6
    eam
    eam is offline
    Registered User eam's Avatar
    Join Date
    Oct 2003
    Posts
    53
    I figured it out. Thanks for your help

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Retrieving the text from an edit box
    By chrishowarth in forum Windows Programming
    Replies: 13
    Last Post: 05-13-2007, 06:57 PM
  2. Capture Enter key press in EDIT Box
    By richiev in forum Windows Programming
    Replies: 4
    Last Post: 07-14-2005, 12:03 AM
  3. Appending text to an edit control
    By dit6a9 in forum Windows Programming
    Replies: 3
    Last Post: 08-13-2004, 09:52 PM
  4. Edit Box Questions PT. II
    By Quantrizi in forum Windows Programming
    Replies: 16
    Last Post: 08-12-2003, 10:42 PM
  5. Ok, Structs, I need help I am not familiar with them
    By incognito in forum C++ Programming
    Replies: 7
    Last Post: 06-29-2002, 09:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21