🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.controls
Article #46

Re: Problems with GETDIBCOLORTABLE and SETDIBCOLORTABLE

#46
From: Jonathan Caryl
Date: Thu, 24 Sep 1998 00:00
38 lines
1725 bytes

dond wrote:

> hol� !
> I have some problems with the two DIB's functions GetDIBColorTable and
> SetDIBColorTable.
> How can I use this two functions ?
> Where is my error ?
> Here is some lines of my code:
>
> /////////////////
>      CBitmap *pBitmap=pDoc->GetBitmap();
>      CDC memDC;
>      memDC.CreateCompatibleDC(pDC);
>

<snip>

>       UINT C=::SetDIBColorTable(memDC,0,256,pRGB);
> <snip>



> this comes from my OnDraw(CDC *pDC) function of my View Class;
>
> The ERROR is return as 6, that is to say "6  The handle is invalid.
> ERROR_INVALID_HANDLE "
>
> When I use GetDIBColorTable this is the same errors.
>
> Can someone help me to use this two functions !

If you look at the docs for SetDIBColorTable you'll see it needs a HDC, but
you're passing it a CDC. Which won't do. You should be able to use the HDC of
the CDC -- i.e. memDC.m_hDC.

Jonathan
Technical Details
Message-ID: <360A5C37.F0AB7789@owl.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6ucvem$l3n@news.u-strasbg.fr>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 1138df,e7fb770ebbd2d886
X-Google-Attributes: gid1138df,public
X-Google-Thread: 1053e6,e7fb770ebbd2d886
X-Google-Attributes: gid1053e6,public
X-Google-Thread: f7033,e7fb770ebbd2d886
X-Google-Attributes: gidf7033,public
From: Jonathan Caryl <jonc@owl.co.uk>
Subject: Re: Problems with GETDIBCOLORTABLE and SETDIBCOLORTABLE
Date: 1998/09/24
Message-ID: <360A5C37.F0AB7789@owl.co.uk>
X-Deja-AN: 394383834
Content-Transfer-Encoding: 8bit
References: <6ucvem$l3n@news.u-strasbg.fr>
Content-Type: text/plain; charset=iso-8859-1
Organization: Panasonic OWL (post doesn't reflect the views of Panasonic OWL)
Mime-Version: 1.0
Newsgroups: comp.os.ms-windows.programmer.controls,comp.os.ms-windows.programmer.tools.mfc,fr.comp.os.ms-windows.programmation