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. is it too late or i do not undestand something

is it too late or i do not undestand something

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 5 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.
  • O Offline
    O Offline
    oOomen
    wrote on last edited by
    #1

    i just copmiled those lines ...... CClientDC dc(this); OnPrepareDC(&dc); dc.SetPixel( point, RGB(0, 0, 0,) ); ...... what i've got is: ---------------------- Done ---------------------- Build: 1 succeeded, 0 failed, 0 skipped but this line contains more commaz that it needs: dc.SetPixel( point, RGB(0, 0, 0,) ); and it works any way do someone know why?

    A C P C 4 Replies Last reply
    0
    • O oOomen

      i just copmiled those lines ...... CClientDC dc(this); OnPrepareDC(&dc); dc.SetPixel( point, RGB(0, 0, 0,) ); ...... what i've got is: ---------------------- Done ---------------------- Build: 1 succeeded, 0 failed, 0 skipped but this line contains more commaz that it needs: dc.SetPixel( point, RGB(0, 0, 0,) ); and it works any way do someone know why?

      A Offline
      A Offline
      axid3j1al
      wrote on last edited by
      #2

      Does it run successfully in Release/Debug? Regards, Axe

      1 Reply Last reply
      0
      • O oOomen

        i just copmiled those lines ...... CClientDC dc(this); OnPrepareDC(&dc); dc.SetPixel( point, RGB(0, 0, 0,) ); ...... what i've got is: ---------------------- Done ---------------------- Build: 1 succeeded, 0 failed, 0 skipped but this line contains more commaz that it needs: dc.SetPixel( point, RGB(0, 0, 0,) ); and it works any way do someone know why?

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        RGB is a macro, so you should see what it expands to in order to see what is going on here. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder

        1 Reply Last reply
        0
        • O oOomen

          i just copmiled those lines ...... CClientDC dc(this); OnPrepareDC(&dc); dc.SetPixel( point, RGB(0, 0, 0,) ); ...... what i've got is: ---------------------- Done ---------------------- Build: 1 succeeded, 0 failed, 0 skipped but this line contains more commaz that it needs: dc.SetPixel( point, RGB(0, 0, 0,) ); and it works any way do someone know why?

          P Offline
          P Offline
          Prakash Nadar
          wrote on last edited by
          #4

          COLORREF SetPixel( int x, int y, COLORREF crColor ); COLORREF SetPixel( POINT point, COLORREF crColor ); these are the two overloaded functions of SetPixel. So your function call fits the second case and so it will work.


          MSN Messenger. prakashnadar@msn.com Tip of the day of visual C++ IDE. "We use it before you do! Visual C++ was developed using Visual C++"

          1 Reply Last reply
          0
          • O oOomen

            i just copmiled those lines ...... CClientDC dc(this); OnPrepareDC(&dc); dc.SetPixel( point, RGB(0, 0, 0,) ); ...... what i've got is: ---------------------- Done ---------------------- Build: 1 succeeded, 0 failed, 0 skipped but this line contains more commaz that it needs: dc.SetPixel( point, RGB(0, 0, 0,) ); and it works any way do someone know why?

            C Offline
            C Offline
            Cedric Moonen
            wrote on last edited by
            #5

            I think (I'm not sure :~ ) that the compiler will ignore everything that doesn't fit int the macro definition. So for example you can put everything you want after the last zero (if separated by a comma of course, otherwise it will be detected as a single 'variable'). So for example: this will compile: dc.SetPixel( point, RGB(0, 0, 0, UnknowVariable) ); even if UnknowVariable is not declared. In fact, a macro is just a way to tell the compiler to replace a portion of text by another text just before the compilation... Hope this helps

            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