![]() |
| | #1 |
| Registered User Join Date: Sep 2004
Posts: 20
| HBITMAP in Class [lalala.h] class Bitmap { HBITMAP hBitmap; public: void Function1(); void Function2(); ); [lalala.cpp] void Function1() { hBitmap = (HBITMAP)LoadImage(0, "a.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); } void Function2() { BITMAP BMP; HDC hDC; GetObject(hBitmap, sizeof(BMP), &BMP); HDC BMPDC = CreateCompatibleDC(NULL); hDC = GetDC(hBtn); SelectObject(BMPDC, hBitmap); BitBlt(hDC, 0, 0, 10, 10, BMPDC, 0, 0, SRCCOPY); ReleaseDC(hBtn, hDC); DeleteDC(BMPDC); DeleteObject(hBitmap); } It`s just an example because real code a bit more confusion, but whatever... So I can`t SelectObject hBitmap :/ if I load hBitmap in Function2() it selects find... what`s wrong here? THNX C ya (:
__________________ Butterfly sweep can make torando in another side of world |
| Born_2B_Alone is offline | |
| | #2 |
| Registered User Join Date: May 2004
Posts: 214
| i dont know the solution to your problem but i can help you by saying use code tags when posting code on this forum, this way some people may answer your question
__________________ Good Help Source all round Good help for win programmers you will probably find something in here this thing also helps if you have never tried any of the above then maybe you should, they help alot |
| Rare177 is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| matrix class | shuo | C++ Programming | 2 | 07-13-2007 01:03 AM |
| Screwy Linker Error - VC2005 | Tonto | C++ Programming | 5 | 06-19-2007 02:39 PM |
| Creating a database | Shamino | Game Programming | 19 | 06-10-2007 01:09 PM |
| structure vs class | sana | C++ Programming | 13 | 12-02-2002 07:18 AM |
| Abstract class problem | VanJay011379 | C++ Programming | 9 | 07-31-2002 01:30 PM |