Thread: new functions in a win32 application

  1. #31
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    What IDs did you give hwnddateEdit, hwndEdit, hwndbutton and hwndMonthCal?

    Do you think that this will cause issues when using the ID to switch in the WM_COMMAND handler? (assuming Windows allows you to create the controls in the first place)

    BTW I am not using a complier to find these errors, I am just carefully reading your code.

    EDIT:
    You are not returning a value after processing a msg but letting it fall thru to the default msg handler.

    Returning a value (and not calling the default handler) is required.
    The return varies depending on the msg type (WM_COMMAND req a 0 return to show you handled the msg).
    This is because some of your functions say they return an int but do not actually have a 'return iValue;' call in them. But as you have defined them as return'ing an int sized block of memory, some random number probably will be returned (and you use this random return).

    Check my code, you will see I return'ed a value to show I had handled each msg.
    I also ensured that the default handler was only called if I did not handle the msg.
    Last edited by novacain; 07-30-2010 at 11:02 PM. Reason: grumpy, spent the week fixing code written by someone who did not care about the quality of their work.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Array of functions
    By frktons in forum C Programming
    Replies: 29
    Last Post: 06-30-2010, 09:51 AM
  2. First time Creating Win32 application with UI
    By chiefmonkey in forum Windows Programming
    Replies: 9
    Last Post: 09-23-2009, 11:44 AM
  3. Replies: 6
    Last Post: 05-15-2007, 10:47 PM
  4. Painting with Tex on a Win32 Application
    By webzest in forum C++ Programming
    Replies: 5
    Last Post: 08-16-2004, 03:04 PM
  5. Can I Load A Sound or Music Into My Win32 Application ?
    By SonicWave in forum Windows Programming
    Replies: 8
    Last Post: 09-21-2001, 07:54 AM