Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 VAX 124x: overloaded operators
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Aug 09 2004 :  2:28:37 PM  Show Profile
When overloading operators multiple times, the HCB shows only one. But when overloading constructors or functions multiple times, they are all shown in the HCB. The member list also shows all overloaded members (although its annoying to see 20 "operator=" in the members list because you dont know what it is anyway without the parameters.

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Aug 10 2004 :  6:57:42 PM  Show Profile
i can reproduce the HCB problem with the class:

class test_class
{
public:
    test_class();
    test_class(int a);
    ~test_class();
    test_class &operator=(int a);
    test_class &operator=(long a);
    test_class &operator=(size_t a);
};


case=205


i am only getting one "operator =" line in the members list though. i don't know why i am getting one, and you are getting several. one entry in the members listbox is consistent, since i only get one entry for the constructors, with both versions listed via a tooltip.

do you get tooltips for the operator functions as you move the current item up and down the members list? i am getting no tooltip for the operator line.

VS .NET 2002 and VAX 1246 on this machine.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Aug 10 2004 :  8:05:04 PM  Show Profile
When you make the definition an declaration (just add { }) then you have all operators in the member list.
No tooltips here too.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Aug 11 2004 :  3:02:08 PM  Show Profile
i have changed the .h to say:

    void operator=(int a) {};
    void operator=(long a) {};
    void operator=(size_t a) {};

and i still only get one entry in the members listbox

i have reparsed the files, and VAX has had 10 minutes to catch up, all with no effect.

do you have time to check this sample class on your machine? i am not seeing what you are seeing.

no tooltip on member listbox added, case=207

zen is the art of being at one with the two'ness

Edited by - feline on Aug 11 2004 3:02:37 PM
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Aug 11 2004 :  9:48:03 PM  Show Profile
Tested it with your sample before and just added the brackets. Copy/Paste into an standard stdafx.h file -> multiple "operator=" entries in the members dropdown.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Aug 12 2004 :  3:39:05 PM  Show Profile
*um*


this isn't what i expected to see. i think i have just reproduced 903

i have closed and reopened the IDE, this VA View effect is 100% reproducible here.
case=209


Uniwares, i tried adding
#include <stdafx.h>

to 3 different test projects. none of these would compile, since none of them could find this file.

i did a find, and there are 24 separate files called "stdafx.h" on my machine under Visual Studio. since the location sounded good, i copied:
C:\\Program Files\\Microsoft Visual Studio .NET\\Vc7\\VCWizards\\win32wiz\\templates\\1033\\stdafx.h

to the project directory for my test program. i am using VS .NET 2002, so you may not have this file in this location with a different version.

i then added the class to the end of my local "stdafx.h", after the line that said
// TODO: reference additional headers your program requires here

and then i added #include "stdafx.h" to the top of my cpp file.

i am still only getting one operator = line in the members listbox *puzzled*

what am i doing differently?

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Aug 12 2004 :  4:09:32 PM  Show Profile
Your picture does not load, so I cant tell what you see.

Anyway, a stdafx.h is created everytime you create a new project (well most of them include this file). The one you used, is a template file from a wizard, probably not useable at all.

Besides, I dont know what else is different. I see many operators as soon as the definition is the declaration or the implementation is at least in the same file.
Should be reproducible somehow.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Aug 12 2004 :  4:34:33 PM  Show Profile
the picture loads for me *puzzled*

what sort of project are you creating? i normally create empty windows projects, command prompt projects, or possibly dll projects.

i haven't yet mastered win32 programming. i will get out my win32 programming book and have a go at creating a hello world program to test this.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Aug 12 2004 :  4:57:28 PM  Show Profile
Just create a hello world console application from the wizard. It will contain a stdafx.h. I wont bother you with creating a Win32 service , it would not make a difference anyway.

PS: the picture does not load for me because the site is blocked on our firewall/proxy...
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Aug 13 2004 :  2:42:02 PM  Show Profile
are you are using .NET 2003? i seem to recall you complaining about it

using .NET 2002 i have created a new win32 project, and in application settings i selected "console application". this time i left "empty project" unticked.

as you said, i get "stdafx.h", along with "stdafx.cpp" and "tomato_test.cpp", the name of this new project.

to the end of "stdafx.h" i added

class test_class
{
public:
    test_class()        {};
    test_class(int a)   {};
    ~test_class()       {};
    test_class &operator=(int a)    {};
    test_class &operator=(long a)   {};
    test_class &operator=(size_t a) {};
};


and in my _tmain(...) function i added:

    test_class foo;
    foo.|

i still only get one "operator =" entry in the members listbox

if you have a test project that does this, can you zip it up and email it to me at [email protected] and i will try and pin down the key difference. i am back to work on monday, so i can try this on .NET 2003 then.

as for the picture, i will ask support about getting such screen shots hosted on their server, to help avoid this problem in future.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Aug 13 2004 :  3:21:54 PM  Show Profile
Ok, now I got you. you are talking about the members in the completion list, I am talking about the "Members drop down list" which is the list at the top of the source window (Alt+M).

Yes, I am using VS2003.NET now, and I am still complaining. It sucks. But its support for templates is better.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Aug 13 2004 :  6:34:37 PM  Show Profile
*doh* now this makes sense. case=211

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000