Click here to Skip to main content
15,925,661 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC Menu Graying. Pin
kiasu_kid23-Nov-03 18:26
kiasu_kid23-Nov-03 18:26 
GeneralRe: MFC Menu Graying. Pin
jbarton24-Nov-03 3:18
jbarton24-Nov-03 3:18 
Questionhow could i draw an irregular dialog according to an image Pin
ttemp200223-Nov-03 14:26
ttemp200223-Nov-03 14:26 
AnswerRe: how could i draw an irregular dialog according to an image Pin
Prakash Nadar23-Nov-03 16:41
Prakash Nadar23-Nov-03 16:41 
AnswerRe: how could i draw an irregular dialog according to an image Pin
John R. Shaw23-Nov-03 16:57
John R. Shaw23-Nov-03 16:57 
GeneralSetWindowLong indicates blocked thread. Pin
suninwater23-Nov-03 13:42
suninwater23-Nov-03 13:42 
GeneralRe: SetWindowLong indicates blocked thread. Pin
Prakash Nadar23-Nov-03 16:47
Prakash Nadar23-Nov-03 16:47 
GeneralCreateDIBSection Pin
John R. Shaw23-Nov-03 12:58
John R. Shaw23-Nov-03 12:58 
I am trying finish a class worthy of publishing at codeproject.
But I have run into a problem, loading a compressed image from file.

Does any one have an idea why this is failing?

hBitmap = CreateDIBSection(NULL, pInfo, DIB_RGB_COLORS, &pBits, NULL, 0);

Result: hBitmap = NULL

Last Error: The parameter is incorrect.

pInfo consist of the following (from debug dump):

BITMAPINFOHEADER:
{
Size = 40
Width = 800
Height = 600
Planes = 1
BitCount = 8
Compression = BI_RLE8
SizeImage = 267738
XPelsPerMeter = 0
YPelsPerMeter = 0
ClrUsed = 0
ClrImportant = 0
};

COLOR TABLE
{
000) 16, 16, 15
001) 18, 0E, 22
...
254) F4, F3, ED
255) F5, F4, F6
};

Note: I've not showing complete color-table from dump (it is correct).

Now here is what I know for a fact:
1) Incorrect parameter is pInfo.
2) The data dumped matches the data produced
by GetDIBits() when the bitmap was saved
to a disk file.
3) The "Paint" program that come with Windows has no
problem open and displaying the file.

I did experince a simular problem once before, that was an error on my part which made me say Da when I found it. But I see nothing wrong here and since the "Paint" can open it I assume (ass-u-me) that there is nothing wrong with the file.

INTP
GeneralRe: CreateDIBSection Pin
Terry O'Nolley23-Nov-03 13:24
Terry O'Nolley23-Nov-03 13:24 
GeneralRe: CreateDIBSection Pin
John R. Shaw23-Nov-03 14:14
John R. Shaw23-Nov-03 14:14 
GeneralRe: CreateDIBSection Pin
Terry O'Nolley23-Nov-03 14:42
Terry O'Nolley23-Nov-03 14:42 
GeneralRe: CreateDIBSection Pin
John R. Shaw23-Nov-03 15:35
John R. Shaw23-Nov-03 15:35 
GeneralModifying MFC document data Pin
aboutQ23-Nov-03 12:45
aboutQ23-Nov-03 12:45 
GeneralRe: Modifying MFC document data Pin
John R. Shaw23-Nov-03 13:25
John R. Shaw23-Nov-03 13:25 
GeneralRe: Modifying MFC document data Pin
Terry O'Nolley23-Nov-03 14:45
Terry O'Nolley23-Nov-03 14:45 
GeneralApplication Restoring Pin
dddfdf23-Nov-03 12:19
dddfdf23-Nov-03 12:19 
GeneralRe: Application Restoring Pin
John R. Shaw23-Nov-03 13:39
John R. Shaw23-Nov-03 13:39 
GeneralRe: Application Restoring Pin
bnn3nasdfasdfa24-Nov-03 2:06
bnn3nasdfasdfa24-Nov-03 2:06 
QuestionHow to bind data to DataGrid using CRecordset? Pin
bilas23-Nov-03 11:43
bilas23-Nov-03 11:43 
GeneralCArchive mapping Pin
DougW4823-Nov-03 10:38
DougW4823-Nov-03 10:38 
GeneralRe: CArchive mapping Pin
Peter Molnar23-Nov-03 13:37
Peter Molnar23-Nov-03 13:37 
GeneralButtons with Icons - In Dialog editor Pin
Antti Keskinen23-Nov-03 9:04
Antti Keskinen23-Nov-03 9:04 
GeneralRe: Buttons with Icons - In Dialog editor Pin
John R. Shaw23-Nov-03 13:55
John R. Shaw23-Nov-03 13:55 
GeneralRe: Buttons with Icons - In Dialog editor Pin
Antti Keskinen24-Nov-03 2:30
Antti Keskinen24-Nov-03 2:30 
GeneralRe: Buttons with Icons - In Dialog editor Pin
John R. Shaw24-Nov-03 5:34
John R. Shaw24-Nov-03 5: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.