Click here to Skip to main content
15,902,198 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: What is being Jitted? Pin
Ray Kinsella3-May-08 4:02
Ray Kinsella3-May-08 4:02 
Questiondotnetfx2 Pin
sas94912-May-08 8:43
sas94912-May-08 8:43 
AnswerRe: dotnetfx2 Pin
Pete O'Hanlon2-May-08 8:55
mvePete O'Hanlon2-May-08 8:55 
GeneralRe: dotnetfx2 Pin
sas94912-May-08 10:57
sas94912-May-08 10:57 
AnswerRe: dotnetfx2 Pin
Thomas Stockwell2-May-08 10:57
professionalThomas Stockwell2-May-08 10:57 
QuestionWord Viewer .OCX ???? Pin
devboycpp2-May-08 7:54
devboycpp2-May-08 7:54 
AnswerRe: Word Viewer .OCX ???? Pin
Pete O'Hanlon2-May-08 8:30
mvePete O'Hanlon2-May-08 8:30 
QuestionMissing The Point Pin
Oddball2-May-08 6:10
Oddball2-May-08 6:10 
Hey, everyone. I ran into a little puzzler this morning that took me back to my early days of OOP, and I'd appreciate it if someone could point out what I'm failing to understand.

I was attempting to check the values of two System::Drawing::Point objects for equality, and the equality operator did not behave as I expected. Now, before you jump all over me about it, I do understand the difference between using the virtual method Object::Equals() and the equality operator '==' on two handles. Well, at least, I thought I did until I decided I might just be crazy a few minutes ago.

I know that operator== will only check to see if two handles refer to the same instance unless it is overridden to do value checking instead, but it is overridden for the Point class. MSDN reports that System::Drawing::Point::operator==() "compares two Point objects. The result specifies whether the values of the X and Y properties of the two Point objects are equal."

My silly little test case (in C++/CLI) follows:
Point^ p1 = gcnew Point(0, 0);
Point^ p2 = gcnew Point(0, 0);

label1->Text = (p1 == p2).ToString();
label2->Text = (p1->Equals(p2)).ToString();


Label1 reads "false" and label2 reads "true," which is the behavior I would expect if the Point class didn't override operator==, but it appears to. I've Googled around and searched through a few forums, but haven't found anyone complaining of the same issue.

I know this just has to be some silly little error that I'm making, either in implementation or understanding, and I'm going to be embarrassed when someone smacks me with the clue bat. I'd much rather understand and be embarrassed than continue to misunderstand, though.

Thanks, gang, and try to be gentle. Smile | :)
AnswerRe: Missing The Point Pin
Thomas Stockwell2-May-08 11:02
professionalThomas Stockwell2-May-08 11:02 
GeneralRe: Missing The Point Pin
Oddball2-May-08 11:22
Oddball2-May-08 11:22 
QuestionReflection Question Pin
MrColeyted1-May-08 22:41
MrColeyted1-May-08 22:41 
QuestionRe: Reflection Question Pin
Urs Enzler2-May-08 4:28
Urs Enzler2-May-08 4:28 
AnswerRe: Reflection Question Pin
Fayu5-May-08 13:46
Fayu5-May-08 13:46 
QuestionCXX0017: Error: symbol "hr" not found Pin
nilam24771-May-08 22:06
nilam24771-May-08 22:06 
AnswerRe: CXX0017: Error: symbol "hr" not found Pin
Mike Dimmick2-May-08 6:08
Mike Dimmick2-May-08 6:08 
QuestionWhy .net code is in .h File not in .cpp file Pin
Abhijit D. Babar1-May-08 20:06
Abhijit D. Babar1-May-08 20:06 
AnswerRe: Why .net code is in .h File not in .cpp file Pin
Urs Enzler2-May-08 4:31
Urs Enzler2-May-08 4:31 
QuestionNeed for a rich Text Editor .... Pin
devboycpp1-May-08 19:12
devboycpp1-May-08 19:12 
AnswerRe: Need for a rich Text Editor .... Pin
Christian Graus1-May-08 19:32
protectorChristian Graus1-May-08 19:32 
AnswerRe: Need for a rich Text Editor .... Pin
Vasudevan Deepak Kumar2-May-08 0:44
Vasudevan Deepak Kumar2-May-08 0:44 
AnswerRe: Need for a rich Text Editor .... Pin
Reelix6-May-08 22:53
Reelix6-May-08 22:53 
QuestionChange Directory type info Pin
coleydog1-May-08 13:12
coleydog1-May-08 13:12 
QuestionStrange Behavior with Generics Pin
girijaa30-Apr-08 6:09
professionalgirijaa30-Apr-08 6:09 
AnswerRe: Strange Behavior with Generics Pin
Urs Enzler1-May-08 10:12
Urs Enzler1-May-08 10:12 
QuestionUnsafe Assembly Permissions Pin
Brady Kelly30-Apr-08 5:15
Brady Kelly30-Apr-08 5:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.