Overloaded ^ ? What does this code do?


I just got this code from the MSDN site to add a control to a form.

private:
System::Void button1_Click(System::Object ^ sender,
System::EventArgs ^ e)
{
TextBox ^ myText = gcnew TextBox();
myText->Location = Point(25,25);
this->Controls->Add(myText);
}

I'm fairly new to C++ but thought I knew my operators. What does "System::Object ^ sender", "System::EventArgs ^ e" and "TextBox ^ myText" do?

Have they overloaded the Exclusive OR operator? What does it do?
That is not standard C++, that is CLR .NET.
It's meaning is similar to *

eg:
 
system::object *sender;
closed account (z05DSL3A)
It is a handle in C++/CLI (See: ECMA-372)

handle — A handle is called an “object reference” in the CLI specification. For any CLI class type T, the declaration T^ h declares a handle h to type T, where the object to which h is capable of pointing resides on the CLI heap. A handle tracks, is rebindable, and can point to a whole object only.


ECMA-372 http://www.ecma-international.org/publications/standards/Ecma-372.htm
Topic archived. No new replies allowed.