Suppress LoadLibraryEx error message?

This is a discussion on Suppress LoadLibraryEx error message? within the Windows Programming forums, part of the Platform Specific Boards category; When I use the LoadLibraryEx API to load a PE file and it fails for whatever reason, it sends a ...

  1. #1
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,705

    Suppress LoadLibraryEx error message?

    When I use the LoadLibraryEx API to load a PE file and it fails for whatever reason, it sends a message box to the user rather than simply returning NULL. I looked around to see if there was a flag that could be used to supress this behavior, but haven't found one.

    Any ideas?

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,705
    Ah, got it:

    Code:
    	
    SetErrorMode( SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX );
    It is a global setting, unfortunately (within the context of the program, that is), but luckily that isn't going to be a problem, in this case.

Popular pages Recent additions subscribe to a feed

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