I've been trying to do something supposedly simple, but as usual, it's not working for me, in dubious circumstances. What I want to do is simply load a bitmap to the screen and keep it there. The (popup) window will have no controls, cannot be moved, and will only handle WM\_PAINT through it's pump; like a splash screen.

The code compiles fine and runs fine during debug mode, but when I switch to release mode `LoadImage()` invariably returns `NULL` and everything else fails as a result. This is my fourth hour spent on this one method and I think it's time to ask for help.
I have checked for uninitialized memory and can ensure that every class member used is initialized to `0`, and am reasonably sure that this is not the problem.
I'll post the code below, and thanks a lot for your help.

I'd prefer to only do this using WinAPI, if possible, because I won't have a use for this functionality anywhere else in this application. Of course I'm still open to ideas, but most likely I'm just making a stupid error. Again, thanks!

---

```
int CreateWindowWithUserFormat()
{   
    SIZE BMSize = {0};
    LoadedBitmap = (HBITMAP) LoadImage(NULL,
    L"Art\\Splash_Screens\\1.bmp", IMAGE_BITMAP,
    NULL, NULL, LR_LOADFROMFILE);

    if(!LoadedBitmap) {
    MessageBox(NULL,
        L"Error loading image to void * HBITMAP",
        L"Error Loading Splash", NULL);
    }

    ScreenDevCtxt = CreateCompatibleDC(NULL);
    if(!ScreenDevCtxt) {
    //Failure
    }

    ReplacedObject = SelectObject(ScreenDevCtxt, (HGDIOBJ) LoadedBitmap);
    if(ReplacedObject == NULL || ReplacedObject == HGDI_ERROR) {
    //Failure
    }

    if( (!GetBitmapDimensionEx(LoadedBitmap, &BMSize) ) ||
    BMSize.cx == 0 || BMSize.cy == 0) {
    //Failure, try alternate:
        BITMAP Bm = {0};
    if( (!GetObject(LoadedBitmap, sizeof(Bm), &Bm) ) ||
        Bm.bmWidth == 0 || Bm.bmHeight == 0) {

    MessageBox(NULL,
        L"Error getting bitmap size; loading aborted.",
        L"Error Loading Splash Image", NULL); 
    }
    // Alternate success; use these as size.
    BMSize.cx = Bm.bmWidth;
    BMSize.cy = Bm.bmHeight;
    }

    {
    RECT WindowSize = {0};
    WinHelper.CenterRectInScreen(WindowSize, BMSize.cx, BMSize.cy);

    if(!Create(L"TitleName",
        WS_POPUPWINDOW | WS_EX_TOPMOST,
        WS_EX_TRANSPARENT,
        WindowSize.left, WindowSize.top,
        WindowSize.right, WindowSize.bottom,
        NULL, NULL) )
    {
        return false;
    }
    return true;
    }
}

```

---

It's probably worth mentioning that this runs on it's own thread. The thread wrapper is responsible for destroying this window when it receives a signal from the application and a certain time has passed (5 seconds, I believe). I'm reasonably sure this isn't the root of the problem, but who knows; I'm out of ideas. 
The problem only arises in release mode, and yes, the release mode still has access to the file (`Art\\Splash_Screens\\1.bmp`). What can I do to solve this?

**Update**
Well, it only took a few minutes after this to realize the path was the error...
I still don't know *why*, but apparently it works fine if we take out the intermediate folders and stick `"1.bmp"` directly next to the executable. Thank you guys.