I am attempting to load a file from a relative file path in win32 via the LoadImage
function. The URL I am using definitely exists as I am, for testing purposes, using the same URL as an added bitmap in the resource file.
Image = (HBITMAP)LoadImage(NULL, "..\\..\\Images\\Mage default.bmp",
IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
However, it is returning error code 2, indicating the file can't be found. I have googled the issue at some length, and referred to MSDN, and I can't find anything stating how to use a relative file path with LoadImage
.
It seems to work fine with LoadBitmap
and a pre-defined bitmap, but doesn't seem to work in this case. Any help would be much appreciated