C Board  

Go Back   C Board > Platform Specific Boards > Windows Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 10-09-2004, 11:55 AM   #1
Registered User
 
Join Date: Sep 2004
Posts: 20
HBITMAP in Class

Hello. So...I wanna To load 3 bitmap`s in one function. Ant after that Select it from another function I did like that:

[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   Reply With Quote
Old 10-09-2004, 05:47 PM   #2
Registered User
 
Rare177's Avatar
 
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   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

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


All times are GMT -6. The time now is 01:53 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22