Click here to Skip to main content
15,891,788 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralLisView Pin
29-Jan-01 3:20
suss29-Jan-01 3:20 
QuestionHow to change the caption of the "open" button? Pin
leonwoo29-Jan-01 2:56
leonwoo29-Jan-01 2:56 
AnswerRe: How to change the caption of the Pin
Christian Graus29-Jan-01 11:28
protectorChristian Graus29-Jan-01 11:28 
GeneralRe: How to change the caption of the Pin
29-Jan-01 11:54
suss29-Jan-01 11:54 
QuestionDo VB ActiveX DLLs have to be so hard to use? Pin
Brendan Tregear28-Jan-01 18:50
Brendan Tregear28-Jan-01 18:50 
AnswerRe: Do VB ActiveX DLLs have to be so hard to use? Pin
29-Jan-01 1:14
suss29-Jan-01 1:14 
Questionblit a bmp as dlg background? Pin
28-Jan-01 11:57
suss28-Jan-01 11:57 
AnswerRe: blit a bmp as dlg background? Pin
Christian Graus28-Jan-01 12:20
protectorChristian Graus28-Jan-01 12:20 
Gosh, this is a long way around it. While it is always great to catch your old selected objects, in the case of a bitmap, the old one in a newly created DC is 1x1, and I believe the return you are getting may even be NULL. You're running on 256 color desktop ? I'm just wondering about the palette stuff, I've never had to bother.

Apart from that, I'd suggest doing it like this: ( taken from my code for an installer )

CDC memDC;
memDC.CreateCompatibleDC(NULL);
CBitmap Bitmap;
Bitmap.LoadBitmap(IDB_FRONTSCREEN);
memDC.SelectObject(&Bitmap);
CPaintDC pdc(this);
pdc.BitBlt(0,0,Bitmap.GetWidth(),Bitmap.GetHeight(),&memDC,0,0,SRCCOPY);

assuming that the bitmap is the same size as the window. I would tend nowadays to more generic code and write the stuff to figure out the stretchblt instead, because it leaves me able to change the image/dialog box size later with less hassle.


Christian

The content of this post is not necessarily the opinion of my yadda yadda yadda.

To understand recursion, we must first understand recursion.
QuestionShellExecute??? Pin
28-Jan-01 10:45
suss28-Jan-01 10:45 
AnswerRe: ShellExecute??? Pin
Christian Graus28-Jan-01 10:54
protectorChristian Graus28-Jan-01 10:54 
AnswerRe: ShellExecute??? Pin
29-Jan-01 3:38
suss29-Jan-01 3:38 
Generalip address Pin
loki rasputin28-Jan-01 6:45
loki rasputin28-Jan-01 6:45 
GeneralRe: ip address Pin
28-Jan-01 15:21
suss28-Jan-01 15:21 
GeneralRe: ip address Pin
loki rasputin28-Jan-01 17:26
loki rasputin28-Jan-01 17:26 
GeneralRandom number Pin
28-Jan-01 2:50
suss28-Jan-01 2:50 
GeneralRe: Random number Pin
DanYELL28-Jan-01 4:02
DanYELL28-Jan-01 4:02 
GeneralRe: Random number Pin
28-Jan-01 5:56
suss28-Jan-01 5:56 
GeneralRe: Random number Pin
28-Jan-01 5:56
suss28-Jan-01 5:56 
GeneralAh i just figured it out my self :) Pin
28-Jan-01 6:07
suss28-Jan-01 6:07 
GeneralRe: Random number Pin
Julien28-Jan-01 16:54
Julien28-Jan-01 16:54 
GeneralHidden window is not getting messages Pin
Christian Skovdal Andersen28-Jan-01 2:20
Christian Skovdal Andersen28-Jan-01 2:20 
GeneralRe: Hidden window is not getting messages Pin
29-Jan-01 2:35
suss29-Jan-01 2:35 
QuestionHas anyone worked with CPLEX? linear programming? Pin
DanYELL27-Jan-01 10:28
DanYELL27-Jan-01 10:28 
GeneralHiding a Dialog Pin
27-Jan-01 9:47
suss27-Jan-01 9:47 
GeneralRe: Hiding a Dialog Pin
Michael Dunn27-Jan-01 10:39
sitebuilderMichael Dunn27-Jan-01 10:39 

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.