please I want to know what does this mean??

M

mohamed azaz

hi
please can one tell me what does this code mean

HDC b=::GetDC(this->GetSafeHwnd());


thank you

bye
 
S

sean_in_raleigh

please can one tell me what does this code mean
HDC b=::GetDC(this->GetSafeHwnd());

By parts:

GetDC()

"call a function called GetDC()"


::GetDC()

"which is in the global namespace"


::GetDC(this->GetSafeHwnd())

"and as a parameter to that call, pass the return value of calling
the GetSafeHwnd() method on the object this code is running
against"


b = ::GetDC(this->GetSafeHwnd())

"and save the return value of GetDC() in a variable named 'b'"


HDC b = ::GetDC(this->GetSafeHwnd())

"which is of type 'HDC'"


HDC b = ::GetDC(this->GetSafeHwnd());

"and don't do anything else in this statement"

What those functions/methods actually *do* depends on
your environment, which I don't know anything about,
but that's what the code you posted does.

Sean
 
E

Eric Pruneau

mohamed azaz said:
hi
please can one tell me what does this code mean

HDC b=::GetDC(this->GetSafeHwnd());


thank you

bye

This is MFC code (Microsoft Foundation Classes)

GetSafeHwnd() is a member of CWnd, the base class for all windows.

GetDC function retrieves a handle to a device context (DC) for the client
area of a specified window. So this->GetSafeHwnd() is the handle to your
window.

The handle to the DC (HDC) can be used to draw in the client area of your
window.

Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,176
Messages
2,570,950
Members
47,503
Latest member
supremedee

Latest Threads

Top