How do I load a bitmap from a file?

I'm trying to load bitmaps from external files. When I try to compile the program, it just tells me that it can't find the file in the resource compiler (the .rc file). This is my code:

bitmap = (HBITMAP)LoadImage(NULL, filename, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);

According to a tutorial I found on the internet (which I can't seem to find now), the above code should load the file at the location stored in 'filename', but it just gives me a compile time error. error RC2135: file not found.
Last edited on
I have learned that almost always when the function can't find a file its because the path is incorrect. Try passing a fully qualified location to the function, and not a local address..
What does that mean? Start with c:\ instead of the root directory?
Topic archived. No new replies allowed.