trouble with edit boxes

This is a discussion on trouble with edit boxes within the Windows Programming forums, part of the Platform Specific Boards category; In the attached code I have created an edit box so that I can enter an IP address. Whenever I ...

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    6

    trouble with edit boxes

    In the attached code I have created an edit box so that I can enter an IP address. Whenever I click in it to start typing, the program terminates. I must be forgeting something or doing something wrong but I'm to new to see it.
    Attached Files Attached Files

  2. #2
    Funniest man in this seat minesweeper's Avatar
    Join Date
    Mar 2002
    Posts
    801
    Haven't looked through all the code but there is no break statement at the end of case WM_COMMAND: so the program will run on to the next case, which is WM_DESTROY:

    HTH

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    6
    That didn't work. The program still terminates.

  4. #4
    Registered User
    Join Date
    Oct 2001
    Posts
    81
    You have the (HMENU) of your edit set to the same as your connect button so the second you click in the edit it exicutes the WM_COMMAND 1 case and that case doesn't have a break on it so its falling strait through to the WM_DESTROY. All you need to do is set the (HMENU) field of your edit box to NULL, also place a break at the end of each case so it can't fall through to the WM_DESTROY.

  5. #5
    Registered User
    Join Date
    Jan 2003
    Posts
    6
    thanks, that did the trick.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Edit boxes and integers.
    By big_o in forum Windows Programming
    Replies: 3
    Last Post: 08-28-2005, 06:38 PM
  2. Edit boxes
    By procyon4476 in forum Windows Programming
    Replies: 1
    Last Post: 05-19-2003, 02:45 PM
  3. Edit Boxes
    By ColdFire in forum Windows Programming
    Replies: 2
    Last Post: 02-13-2002, 01:54 PM
  4. please help visual c++ edit control boxes
    By alcoholic in forum C++ Programming
    Replies: 3
    Last Post: 02-05-2002, 01:39 PM
  5. Password Edit Boxes
    By Unregistered in forum Windows Programming
    Replies: 1
    Last Post: 08-27-2001, 02:40 PM

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