   LoadImage returning null
  I am trying to make an application skin using bitmaps.  I have tried both of these functions in order to get my application to load the bitmap before blitting it to the screen:m_hSkinBitmap = (HBITMAP)LoadImage(hInstance, MAKEINTRESOURCE(IDB_MYPIC),IMAGE_BITMAP, 0, 0, LR_LOADMAP3DCOLORS|LR_DEFAULTCOLOR);--and--m_hSkinBitmap = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_MYPIC));When I check if my HBITMAP variable is valid using :    if(!m_hSkinBitmap)   MessageBox(m_hWindow, "Could not load bitmap", "Image Error", MB_OK | MB_ICONERROR);and run the program...my program always displays the error message box.  I have tried just putting "mypic.bmp" in place of the MAKEINTRESOURCE(IDB_MYPIC) because the picture is in the same directory as the executable, but my check still returns false and no image is blitted to the screen...just the default window look.  I have a resource.h file to define the resources and a resource.rc file to name the location of the bitmap image for the resource.  Just to let you know, I followed all of FlipCodes instructions, but I still have this problem.  Can anyone help me?-Sean G.-   
  What error code does GetLastError() return?Have you tried LoadImage(hInstance,"c://fullpath//blah//pic.bmp",IMAGE_BITMAP, 0, 0,LR_LOADFROMFILE);?What happens when you use:LoadImage(hInst,MAKEINTRESOURCE(IDB_MYPIC),IMAGE_BITMAP,0,0,LR_CREATEDIBSECTION);?Good Luck;Quote:Original post by compugeekproI have tried just putting "mypic.bmp" in place of the MAKEINTRESOURCE(IDB_MYPIC) because the picture is in the same directory as the executable, but my check still returns falsethat won't work at all for LoadBitmap, because LoadBitmap always expects a resource identifier (whether you are using string or integer identifiers). it should work for LoadImage, however, as long as you specify the load from file flag with a NULL HINSTANCE parameter.couple things to watch out for:1.) make sure your rc file is included in your project files (i've seen people on here forget to add it to their project and then wonder why their resources don't load). unlike .h and .cpp files, you shouldn't won't get any linker errors if you forget to include your resource files.2.) if using integral resource identifiers, make sure your ids are less than an unsigned short.3.) for LR_LOADMAP3DCOLORS, make sure your bitmap's color format is 8-bits or less.4.) if not using integral resource identifiers, and using strings instead, do not use MAKEINTRESOURCE. just pass the name of the resource as a string directly to the function.   ;  Thank you...I got the load from file option to work.  I was messing with resources so much that I forgot I could just load straight from the file.  As far as resources go, I am going to try it right now.  Thanks for the replies.   ;  I now have both the load from file and load from resource methods working.  It was all a matter of putting quotes ("resource_name") around the resources name.  It works great now.   