Someone please explain this:

This is a discussion on Someone please explain this: within the Windows Programming forums, part of the Platform Specific Boards category; I'm using MessageBox:es to signal that an error has occured in the program, but whenever I use the caption "Error", ...

  1. #1
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145

    Someone please explain this:

    I'm using MessageBox:es to signal that an error has occured in the program, but whenever I use the caption "Error", or something that begins with "Error" (like "ErrorUpMy@$$") the message box instantly closes after activation.
    Why does this happen? What's the point of this?
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Works ok for me

  3. #3
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    My guess is that it's not closing because of the message box but the surrounding code.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  4. #4
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    I made several tests on the same code, only changing the CAPTION field.
    The message box always closes ~0.5 sec after showing up when the CAPTION string begins with "Error", but stays open when it doesn't (until you press OK ).
    Haven't anyone else experienced this?
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  5. #5
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    Nope - care to show your code (not just the msgbox code, but that surrounding it, too)

  6. #6
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    You can download the program + source at my homepage http://www.geocities.com/magos818/cprog/war3color.html.

    As I said the problems only occur when the caption begins with "Error", so I simply named it something else, and the problems were gone.
    They appear again if you rename it to "Error***" again though.

    Very weird!
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can you explain these bitwise operations?
    By 6tr6tr in forum C++ Programming
    Replies: 6
    Last Post: 10-29-2008, 01:19 PM
  2. Please explain?
    By neo_phyte in forum C Programming
    Replies: 3
    Last Post: 08-25-2006, 05:23 AM
  3. Can someone explain to me what this code means
    By Shadow12345 in forum C++ Programming
    Replies: 3
    Last Post: 12-22-2002, 11:36 AM
  4. Replies: 4
    Last Post: 11-19-2002, 08:18 PM
  5. Can someone explain "extern" to me?
    By valar_king in forum C++ Programming
    Replies: 3
    Last Post: 09-16-2001, 12:22 AM

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