Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. ::DeleteObject(hbmpOld);

::DeleteObject(hbmpOld);

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jerry1211a
    wrote on last edited by
    #1

    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 :)

    B M 2 Replies Last reply
    0
    • J jerry1211a

      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 :)

      B Offline
      B Offline
      Blake Miller
      wrote on last edited by
      #2

      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

      J 1 Reply Last reply
      0
      • B Blake Miller

        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

        J Offline
        J Offline
        jerry1211a
        wrote on last edited by
        #3

        Thanks...

        1 Reply Last reply
        0
        • J jerry1211a

          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 :)

          M Offline
          M Offline
          Milton Karimbekallil
          wrote on last edited by
          #4

          :: 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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups