Click here to Skip to main content
16,008,075 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Infinite Linking fights back Pin
John R. Shaw27-May-03 10:13
John R. Shaw27-May-03 10:13 
GeneralRe: Infinite Linking ( This time, i logged on before ) Pin
John M. Drescher27-May-03 10:39
John M. Drescher27-May-03 10:39 
GeneralRe: Infinite Linking ( This time, i logged on before ) Pin
Miszou29-May-03 12:03
Miszou29-May-03 12:03 
GeneralRe: Infinite Linking ( This time, i logged on before ) Pin
Somaa3-Jun-03 13:41
Somaa3-Jun-03 13:41 
GeneralInfinite Linking... Pin
Anonymous26-May-03 14:11
Anonymous26-May-03 14:11 
QuestionDeviceIoControl & OID_802_11_BSSID_LIST_SCAN ? Pin
clintsinger26-May-03 12:08
clintsinger26-May-03 12:08 
AnswerRe: DeviceIoControl & OID_802_11_BSSID_LIST_SCAN ? Pin
amitalonm9-Oct-09 13:21
amitalonm9-Oct-09 13:21 
QuestionWhat is wrong with this way of displaying a bitmap on a window? Pin
Redeemer-dk26-May-03 11:58
Redeemer-dk26-May-03 11:58 
I'm trying to display a bitmap on my window. Here's my code:

BITMAPINFO biBitmap = {0};
BITMAPINFOHEADER bihBitmap = {0};

bihBitmap.biSize = sizeof(BITMAPINFOHEADER);
bihBitmap.biWidth = 16;
bihBitmap.biHeight = 16;
bihBitmap.biPlanes = 1;
bihBitmap.biBitCount = 24;
bihBitmap.biCompression = BI_RGB;
bihBitmap.biSizeImage = 0;
bihBitmap.biClrUsed = 0;
bihBitmap.biClrImportant = 0;

biBitmap.bmiHeader = bihBitmap;

PAINTSTRUCT ps;
HDC hdc = BeginPaint(ghWnd, &ps);		  
HDC hdcMem = CreateCompatibleDC(NULL);

HBITMAP hbm = CreateDIBitmap(hdcMem, &bihBitmap, CBM_INIT, finalrgb, &biBitmap, NULL);
HBITMAP hbmT = (HBITMAP)SelectObject(hdcMem, (HBITMAP)hbm);
		  
BitBlt(hdc,60,60,16,16,hdcMem,0,0,SRCCOPY);
		  
SelectBitmap(hdcMem,hbmT);
DeleteDC(hdcMem);  

EndPaint(ghWnd,&ps);


finalrgb is a pointer to an array of unsigned chars containing RGB values for a 16 by 16 pixels picture.

What am i doing wrong?

Thankyou!
QuestionClassWizard Object IDs? Pin
Jonah Bishop26-May-03 11:39
Jonah Bishop26-May-03 11:39 
AnswerRe: ClassWizard Object IDs? Pin
John R. Shaw26-May-03 12:09
John R. Shaw26-May-03 12:09 
GeneralStretchBlt memory leak Pin
Anonymous26-May-03 11:32
Anonymous26-May-03 11:32 
GeneralRe: StretchBlt memory leak Pin
John R. Shaw26-May-03 11:42
John R. Shaw26-May-03 11:42 
QuestionPicture in a ListCtrl ?? Pin
Cris26-May-03 10:30
Cris26-May-03 10:30 
AnswerRe: Picture in a ListCtrl ?? Pin
Anonymous26-May-03 23:35
Anonymous26-May-03 23:35 
GeneralRe: Picture in a ListCtrl ?? Pin
Cris27-May-03 1:27
Cris27-May-03 1:27 
GeneralDraw text in a pane of a static splitter in a SDI application Pin
Claude Gagnon26-May-03 10:13
Claude Gagnon26-May-03 10:13 
GeneralRe: Draw text in a pane of a static splitter in a SDI application Pin
Neville Franks26-May-03 11:28
Neville Franks26-May-03 11:28 
GeneralRe: Draw text in a pane of a static splitter in a SDI application Pin
John R. Shaw26-May-03 11:57
John R. Shaw26-May-03 11:57 
GeneralCS_SAVEBITS Pin
John R. Shaw26-May-03 8:22
John R. Shaw26-May-03 8:22 
GeneralRe: CS_SAVEBITS Pin
Neville Franks26-May-03 11:31
Neville Franks26-May-03 11:31 
GeneralRe: CS_SAVEBITS Pin
John R. Shaw26-May-03 12:15
John R. Shaw26-May-03 12:15 
GeneralRe: CS_SAVEBITS Pin
Neville Franks26-May-03 12:20
Neville Franks26-May-03 12:20 
GeneralRe: CS_SAVEBITS Pin
John R. Shaw26-May-03 12:48
John R. Shaw26-May-03 12:48 
GeneralRe: CS_SAVEBITS Pin
Neville Franks26-May-03 12:55
Neville Franks26-May-03 12:55 
GeneralRe: CS_SAVEBITS Pin
John R. Shaw26-May-03 13:34
John R. Shaw26-May-03 13:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.