Bitmap Resource Loading
-
Hi there ! I want to load a bitmap from inside my application in order to display it on a dialog box ! In "resource.h" file i wrote: "#define IDB_BITMAP_SPLASH 500" In "resource.rc" file i wrote: "IDB_BITMAP_SPLASH BITMAP "SPLASH.BMP", where SPLASH.BMP is the name of my bitmap file. In "main.cpp" file i wrote: "HBITMAP hBitmap=(HBITMAP)LoadBitmap(hInst,MAKEINTRESOURCE(IDB_BITMAP_SPLASH));", where "hInst" is my application's instance handle. The problem is that this function is returning NULL. I've also tried with "LoadImage()" and "LoadResource()" functions. None of them work ! I've tried instead of MAKEINTRESOURCE to simply write "Splash.bmp" as if i were loading it directly from the file. Does not work ! Can anyone help me :confused:? I'm using Windows 2000 SP4 and i'm not writing this in MFC, but in simple Win32API. ThankYou :)!!!
-
Hi there ! I want to load a bitmap from inside my application in order to display it on a dialog box ! In "resource.h" file i wrote: "#define IDB_BITMAP_SPLASH 500" In "resource.rc" file i wrote: "IDB_BITMAP_SPLASH BITMAP "SPLASH.BMP", where SPLASH.BMP is the name of my bitmap file. In "main.cpp" file i wrote: "HBITMAP hBitmap=(HBITMAP)LoadBitmap(hInst,MAKEINTRESOURCE(IDB_BITMAP_SPLASH));", where "hInst" is my application's instance handle. The problem is that this function is returning NULL. I've also tried with "LoadImage()" and "LoadResource()" functions. None of them work ! I've tried instead of MAKEINTRESOURCE to simply write "Splash.bmp" as if i were loading it directly from the file. Does not work ! Can anyone help me :confused:? I'm using Windows 2000 SP4 and i'm not writing this in MFC, but in simple Win32API. ThankYou :)!!!
Can you view the splash.bmp from the resource editor? -- Rocky Dean Pulley -- DreamSys Software -- http://www.dreamsyssoft.com
-
Hi there ! I want to load a bitmap from inside my application in order to display it on a dialog box ! In "resource.h" file i wrote: "#define IDB_BITMAP_SPLASH 500" In "resource.rc" file i wrote: "IDB_BITMAP_SPLASH BITMAP "SPLASH.BMP", where SPLASH.BMP is the name of my bitmap file. In "main.cpp" file i wrote: "HBITMAP hBitmap=(HBITMAP)LoadBitmap(hInst,MAKEINTRESOURCE(IDB_BITMAP_SPLASH));", where "hInst" is my application's instance handle. The problem is that this function is returning NULL. I've also tried with "LoadImage()" and "LoadResource()" functions. None of them work ! I've tried instead of MAKEINTRESOURCE to simply write "Splash.bmp" as if i were loading it directly from the file. Does not work ! Can anyone help me :confused:? I'm using Windows 2000 SP4 and i'm not writing this in MFC, but in simple Win32API. ThankYou :)!!!
ThEdreamMaker wrote: "HBITMAP hBitmap=(HBITMAP)LoadBitmap(hInst,MAKEINTRESOURCE(IDB_BITMAP_SPLASH));", where "hInst" is my application's instance handle. The problem is that this function is returning NULL Have you checked
GetLastError()
? -- jlr http://jlamas.blogspot.com/[^] -
Can you view the splash.bmp from the resource editor? -- Rocky Dean Pulley -- DreamSys Software -- http://www.dreamsyssoft.com
-
ThEdreamMaker wrote: "HBITMAP hBitmap=(HBITMAP)LoadBitmap(hInst,MAKEINTRESOURCE(IDB_BITMAP_SPLASH));", where "hInst" is my application's instance handle. The problem is that this function is returning NULL Have you checked
GetLastError()
? -- jlr http://jlamas.blogspot.com/[^] -
Hi there ! I want to load a bitmap from inside my application in order to display it on a dialog box ! In "resource.h" file i wrote: "#define IDB_BITMAP_SPLASH 500" In "resource.rc" file i wrote: "IDB_BITMAP_SPLASH BITMAP "SPLASH.BMP", where SPLASH.BMP is the name of my bitmap file. In "main.cpp" file i wrote: "HBITMAP hBitmap=(HBITMAP)LoadBitmap(hInst,MAKEINTRESOURCE(IDB_BITMAP_SPLASH));", where "hInst" is my application's instance handle. The problem is that this function is returning NULL. I've also tried with "LoadImage()" and "LoadResource()" functions. None of them work ! I've tried instead of MAKEINTRESOURCE to simply write "Splash.bmp" as if i were loading it directly from the file. Does not work ! Can anyone help me :confused:? I'm using Windows 2000 SP4 and i'm not writing this in MFC, but in simple Win32API. ThankYou :)!!!
The problem was that hInst was NULL ! Thank you anyway :) !!!!!!! http://gxsoftware.idilis.ro