Click here to Skip to main content
15,910,471 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem with use of Mutex and System Tray Icon Together. Pin
Le@rner7-Aug-09 19:49
Le@rner7-Aug-09 19:49 
AnswerRe: Problem with use of Mutex and System Tray Icon Together. Pin
Randor 7-Aug-09 20:44
professional Randor 7-Aug-09 20:44 
GeneralRe: Problem with use of Mutex and System Tray Icon Together. Pin
Le@rner7-Aug-09 22:30
Le@rner7-Aug-09 22:30 
GeneralRe: Problem with use of Mutex and System Tray Icon Together. Pin
PJ Arends8-Aug-09 6:34
professionalPJ Arends8-Aug-09 6:34 
GeneralRe: Problem with use of Mutex and System Tray Icon Together. Pin
Randor 8-Aug-09 6:52
professional Randor 8-Aug-09 6:52 
GeneralRe: Problem with use of Mutex and System Tray Icon Together. Pin
PJ Arends8-Aug-09 8:09
professionalPJ Arends8-Aug-09 8:09 
GeneralRe: Problem with use of Mutex and System Tray Icon Together. Pin
Randor 9-Aug-09 11:39
professional Randor 9-Aug-09 11:39 
Questionsome confuse about compatible DC and compatible Bitmap Pin
xtwgigu7-Aug-09 17:24
xtwgigu7-Aug-09 17:24 
Recently,I'm learning how to make custom UI,by using BitBlt() put some bitmap to DC.When comes to 'Compatible DC' and 'Compatible Bitmap',i'm confused about codes as follows:

codes in function OnPaint():(VC++)
CDC memDC,tempDC;
CClientDC dc(this);
CBitmap memBmp;
CRect rcClient;

GetClientRect( &rcClient );

memDC.CreateCompatibleDC( &dc );
tempDC.CreateCompatibleDC( &memDC );
memBmp.CreateCompatibleBitmap( &dc, rcClient.Width(), rcClient.Height() );

tempDC.SelectObject( &m_bmp ); //(assume the m_bmp is a initial CBitmap ojbect)

memDC.SelectOjbect( &memBmp ); //First
memDC.BitBlt( p1,p2,..., &tempDc,...., SRCCOPY ); //Second

dc.BitBlt( p1,p2,......, &memDC,....., SRCCOPY ); //Third

//code end

I know how to use these codes but i don't why it does.

1.From codes i marked "First" and "Senond",I wonder if SelectObject( &memBmp ) only gives memDC's data member a value and BitBlt gives memDC something to display? if this why to use SelectObject()?

2.Codes marked "second" and "third". From "second" codes it use &tempDC as its parameter, but tempDC just only used SelectObject( &m_bmp ),i means it doesn't use BitBlt to disply somethig ,why it can be "BitBlt"
to memDC?
From "third" codes,dc's BitBlt use memDC as its parameter,and it executed BitBlt before.So I think this code is correct( but i know all these is correct haha...).
So i wonder,does the process "BitBlt" copys the SrcDC's disply things to DestDC,or copys the SrcDC's Bitmap object(been valued in SelectObject() )to DestDc to display?

My mother language is not English,and my english level is very lower(Sorry).I don't know if someone can understand my means.
I hope all of you gives me some advice,thank you!


this is the first time i asked question in this haha...
AnswerRe: some confuse about compatible DC and compatible Bitmap Pin
Rozis9-Aug-09 8:41
Rozis9-Aug-09 8:41 
GeneralRe: some confuse about compatible DC and compatible Bitmap Pin
xtwgigu9-Aug-09 14:21
xtwgigu9-Aug-09 14:21 
QuestionChanging DefaultSecurity Settings on a New Folder. Pin
Bram van Kampen7-Aug-09 14:44
Bram van Kampen7-Aug-09 14:44 
Question[Message Deleted] Pin
transoft7-Aug-09 9:16
transoft7-Aug-09 9:16 
AnswerRe: C++ question Pin
David Crow7-Aug-09 9:44
David Crow7-Aug-09 9:44 
GeneralRe: C++ question Pin
transoft7-Aug-09 10:15
transoft7-Aug-09 10:15 
QuestionTVN_SELCHANGED double access Pin
Vaclav_7-Aug-09 5:53
Vaclav_7-Aug-09 5:53 
AnswerRe: TVN_SELCHANGED double access Pin
Le@rner7-Aug-09 19:14
Le@rner7-Aug-09 19:14 
GeneralRe: TVN_SELCHANGED double access [modified] Hacked to solve! Pin
Vaclav_8-Aug-09 12:16
Vaclav_8-Aug-09 12:16 
Questionstack,graphics Pin
kumarashoka7-Aug-09 5:46
kumarashoka7-Aug-09 5:46 
AnswerRe: stack,graphics Pin
harold aptroot7-Aug-09 6:01
harold aptroot7-Aug-09 6:01 
AnswerRe: stack,graphics Pin
Chris Losinger7-Aug-09 7:38
professionalChris Losinger7-Aug-09 7:38 
AnswerRe: stack,graphics Pin
David Crow7-Aug-09 9:36
David Crow7-Aug-09 9:36 
GeneralRe: stack,graphics Pin
Chris Losinger8-Aug-09 10:36
professionalChris Losinger8-Aug-09 10:36 
Questionpointer Pin
kumarashoka7-Aug-09 5:21
kumarashoka7-Aug-09 5:21 
AnswerRe: pointer Pin
Maximilien7-Aug-09 5:35
Maximilien7-Aug-09 5:35 
GeneralRe: pointer Pin
harold aptroot7-Aug-09 5:51
harold aptroot7-Aug-09 5:51 

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.