Thread: Whats wrong w/this bitmap ctrl?

  1. #1
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378

    Whats wrong w/this bitmap ctrl?

    k, so i have some code here and it looks just fine to me. but for some reason, i cannot get this control to display my bitmap. here's the entirety of my WM_CREATE case..
    Code:
    case WM_CREATE:
    {
        int i = 0, x = 1000, rnd = 0;
        HINSTANCE hInst = GetModuleHandle(NULL);
                 
        for (i = 0; i < 13; i++)
        {
              spades[i] = (HBITMAP)LoadImage(hInst, MAKEINTRESOURCE(x), IMAGE_BITMAP, 179, 262, LR_SHARED);
              ++x;
         }
         back = (HBITMAP)LoadImage(hInst, MAKEINTRESOURCE(ID_BACK), IMAGE_BITMAP, 179, 262, LR_SHARED);
                 
        CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("STATIC"), TEXT(""), WS_CHILD | WS_VISIBLE | SS_BITMAP | SS_CENTERIMAGE,
           15, 10, 179, 262, hwnd, (HMENU)ID_DEALER1, hInst, 0);
        CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("STATIC"), TEXT(""), WS_CHILD | WS_VISIBLE | SS_BITMAP | SS_CENTERIMAGE,
           104, 112, 179, 262, hwnd, (HMENU)ID_DEALER2, hInst, 0);
                   
         mrsn_seed( (unsigned)time(NULL) );
         rnd = mrsn_rand() % 13;
         SendMessage(GetDlgItem(hwnd, ID_DEALER1), STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)back);
         SendMessage(GetDlgItem(hwnd, ID_DEALER2), STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)spades[rnd]);
    }
    break;
    am i doing something wrong? the compiler gives no errors. thanks
    Last edited by willc0de4food; 01-06-2006 at 05:06 AM.
    Registered Linux User #380033. Be counted: http://counter.li.org

  2. #2
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378
    wow i'm dumb.
    in my resource file, i had:
    ID_BACK IMAGE_BITMAP DISCARDABLE "back.bmp"
    ---------^^^^^ DOH!
    Registered Linux User #380033. Be counted: http://counter.li.org

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. get bitmap from image in website.
    By sgh in forum C# Programming
    Replies: 3
    Last Post: 03-23-2009, 09:34 PM
  2. Need help with Bitmap Display
    By The Brain in forum Windows Programming
    Replies: 7
    Last Post: 03-23-2009, 05:33 AM
  3. How to create and display a bitmap programatically?
    By solar3147 in forum Windows Programming
    Replies: 4
    Last Post: 06-24-2003, 02:55 AM
  4. difficult bitmap question
    By Mecnels in forum Windows Programming
    Replies: 1
    Last Post: 03-13-2003, 07:03 AM
  5. What's wrong with the bitmap?
    By SuperNewbie in forum Windows Programming
    Replies: 3
    Last Post: 03-25-2002, 02:09 PM