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. Managed C++/CLI
  4. simple question

simple question

Scheduled Pinned Locked Moved Managed C++/CLI
question
4 Posts 2 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.
  • . Offline
    . Offline
    ...---...
    wrote on last edited by
    #1

    If I say this.CreateGraphics(); What's "this"?

    M 1 Reply Last reply
    0
    • . ...---...

      If I say this.CreateGraphics(); What's "this"?

      M Offline
      M Offline
      MKlucher
      wrote on last edited by
      #2

      "this" is a key word to refer to the currently instantiated class that the method is in so if you had: public ref class FrmMyCoolForm : public System::Windows::Forms::Form { public: FrmMyCoolForm(void) { this->Visible = false; } } You would be changing the visiblility of the object that the method was called from. (Probably not close to a textbook definition but hope it makes sense) EDIT: Here is a definition C++ keyword used in a member function to point at the object currently being operated on.

      . 1 Reply Last reply
      0
      • M MKlucher

        "this" is a key word to refer to the currently instantiated class that the method is in so if you had: public ref class FrmMyCoolForm : public System::Windows::Forms::Form { public: FrmMyCoolForm(void) { this->Visible = false; } } You would be changing the visiblility of the object that the method was called from. (Probably not close to a textbook definition but hope it makes sense) EDIT: Here is a definition C++ keyword used in a member function to point at the object currently being operated on.

        . Offline
        . Offline
        ...---...
        wrote on last edited by
        #3

        THanks- I inderstad that. I'm referring to the CreateGraphics. CreateGraphics is a "method" when a WHAT is instantiate. int x; this->Foo() == x.Foo() //OK this.CreateGraphics() // What's "this"? in THIS case Is it Graphics g?

        M 1 Reply Last reply
        0
        • . ...---...

          THanks- I inderstad that. I'm referring to the CreateGraphics. CreateGraphics is a "method" when a WHAT is instantiate. int x; this->Foo() == x.Foo() //OK this.CreateGraphics() // What's "this"? in THIS case Is it Graphics g?

          M Offline
          M Offline
          MKlucher
          wrote on last edited by
          #4

          Looks like it's System::Windows::Forms::Control http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformscontrolclasscreategraphicstopic.asp[^] Could be part of other things though.

          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