CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2011
    Posts
    22

    Handling Fatal Errors in WM_CREATE

    Hi guys,

    I'm doing something like this:

    WM_CREATE:
    if(!initialize()){
    // fatal error
    // MessageBox(...);
    // here I should terminate the program
    }

    What's the best way to handle something like that ?

    Thanks.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Handling Fatal Errors in WM_CREATE

    According to MSDN in this case your procedure has to return -1 to destroy the window and case the CreateWindowEx or CreateWindow function returns a NULL handle.
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured