::DeleteObject(hbmpOld);
-
Hello, Sometimes when looking at C++ code I see member function code that contains a statement(s) with 2 colons as shown below: HRESULT CSomeClass::OnDraw() { //2 COLONS HERE -> ::DeleteObject(hbmpOld); } What does the resolution operator refer to inside the function? Thanks, Jerry :)
-
Hello, Sometimes when looking at C++ code I see member function code that contains a statement(s) with 2 colons as shown below: HRESULT CSomeClass::OnDraw() { //2 COLONS HERE -> ::DeleteObject(hbmpOld); } What does the resolution operator refer to inside the function? Thanks, Jerry :)
It means to call the function at the global level, rather than calling the one with the same signature that might be defined as a member of the class. People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
-
It means to call the function at the global level, rather than calling the one with the same signature that might be defined as a member of the class. People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
Thanks...
-
Hello, Sometimes when looking at C++ code I see member function code that contains a statement(s) with 2 colons as shown below: HRESULT CSomeClass::OnDraw() { //2 COLONS HERE -> ::DeleteObject(hbmpOld); } What does the resolution operator refer to inside the function? Thanks, Jerry :)
:: is the resolution operator. It makes the scope of the function to global. usually as there is no global function with the same name declared it will point to the win32 api function. So generally we use this for calling a win32 api. in ur case
::DeleteObject(hbmpOld);
means it invokes this GDI api. cheers..mil10