LoadBitmap function call is constantly failing for some reason

This is a discussion on LoadBitmap function call is constantly failing for some reason within the Windows Programming forums, part of the Platform Specific Boards category; Originally Posted by manuell I have "successfully" reproduced your problem, and fixed it: 1) change the name of the global ...

  1. #16
    Registered User
    Join Date
    Sep 2008
    Posts
    1
    Quote Originally Posted by manuell View Post
    I have "successfully" reproduced your problem, and fixed it:

    1) change the name of the global HINSTANCE variable. (eg: g_hThisInstance)
    2) add g_hThisInstance = hThisInstance; to your WinMain Function.
    3) fix the name used in Information::GameInit
    4) use hbmCross = LoadBitmap(g_hThisInstance, MAKEINTRESOURCE(ID_BMP_CROSS));

    you mind posting the source that you modded to fix the problem??? i have my own problem like this but from what you said up above...it doesn't seem to work....
    (i added in my code too....) (the resource file is just this....)

    Code:
    ////////////////////////////////////////////////////////
    //	Icons
    ///////////////////////////////////////////////////////
    IDI_ICON ICON DISCARDABLE "F:\\TankT_v2\\Tank2.ico"
    
    ///////////////////////////////////////////////////////
    //	Images
    ///////////////////////////////////////////////////////
    IDI_BANNER	BITMAP	DISCARDABLE	"F:\\TankT_v2\\banner.bmp"
    Attached Files Attached Files

  2. #17
    Registered User
    Join Date
    Sep 2008
    Location
    Near Paris
    Posts
    6
    Quote Originally Posted by Elusive_101 View Post
    you mind posting the source that you modded to fix the problem??? i have my own problem like this but from what you said up above...it doesn't seem to work....
    (i added in my code too....) (the resource file is just this....)

    Code:
    ////////////////////////////////////////////////////////
    //	Icons
    ///////////////////////////////////////////////////////
    IDI_ICON ICON DISCARDABLE "F:\\TankT_v2\\Tank2.ico"
    
    ///////////////////////////////////////////////////////
    //	Images
    ///////////////////////////////////////////////////////
    IDI_BANNER	BITMAP	DISCARDABLE	"F:\\TankT_v2\\banner.bmp"
    1) The WM_CREATE message is processed during the CreateWindowEx call. You store the module handle in hInc after that call, thus hInc is 0 when you call LoadBitmap. Add the line
    Code:
    	hInc = hInstance;
    just before the CreateWindow call.

    2) Ressource identifier are integers or strings. If you want integers, add
    Code:
    #include "tankt_header.h"
    on top of your RC file. If you want strings, replace MAKEINTRESOURCE(IDI_BANNER) by "IDI_BANNER"
    Last edited by manuell; 09-23-2008 at 03:34 AM.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 05-13-2011, 08:28 AM
  2. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  3. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 11:45 AM
  4. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 01:28 PM
  5. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 01:53 AM

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