Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1544: resolving operator[]

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
accord Posted - Jan 25 2007 : 5:50:26 PM

template <class T> class tArray {
public:
	T* vector;
	T& operator[](int index) const
	{
		return vector[index];
	}
};

template <class T> class tRef {
public:
	T* Ptr;
	T* operator->() const
	{
		return Ptr;
	}
};

template <class T> class tRefArray
{
public:
	tArray <tRef<T>*> Array;

	tRef<T>& operator[](int index)
	{
		return *Array[index];
	}
};



class cTest1 {
public:
	int Apple;
	int Banana;
};

class cTest2 {
	tRefArray <cTest1> K;
	void Func(void)
	{
		K[0]->Ptr;
	}
};


In this code, if I type K[0]-> into Func() i get completion listbox with these items:

operator ->
Ptr

...which is wrong. VAX should display

Apple
Banana

Certainly when I try to complile the code I have inserted, I get the

error C2039: 'Ptr' : is not a member of 'cTest1'

compiler error message.

(I can reproduce it in a new win32 project. I have inserted the code into the cpp file)
30   L A T E S T    R E P L I E S    (Newest First)
support Posted - Oct 29 2007 : 02:46:37 AM
case=961 is fixed in Build 1614
feline Posted - Feb 26 2007 : 1:08:00 PM
Thank you for the update. If we don't see some motion on this soon I will go and ask how this is going.
khb Posted - Feb 26 2007 : 12:54:07 PM
Well, I expected that, too. I just wanted to inform you.

Regards,
Marcus.
feline Posted - Feb 26 2007 : 12:32:33 PM
Unfortunately this is as expected. case=961, the problem with the wrong items being shown in the listboxes has not yet been fixed.
khb Posted - Feb 26 2007 : 03:07:02 AM
I just tried 1548. Same result as before. "Get content from default intellisence" on: No suggestion at all after typing dot. Ctrl-Space helps. "Get content from default intellisence" off: Suggestions are shown directly. But in both cases I don't get the correct suggestions. The members of the objects stored in the vector are still not shown.

Regards,
Marcus.
accord Posted - Feb 24 2007 : 12:44:18 PM
If it's a help I am also experience the same problem as 4733 with vector template class using operator [].

Turning on "Get content from default intellisence" helps populate completion listbox for vector.

But the same problem: VAX do not recognises the symbol, so VAX's own find references also do NOT work.

So fixing case=4733 will be propably a help for khb also. (maybe in next build )

The parser is the soul of VAX, so eliminating a parser bug is always a GREAT thing
feline Posted - Feb 21 2007 : 08:29:48 AM
*sigh* It is almost as if you are seeing a different problem in your main solution. I have already wondered if this was the case, but proving it really needs the problem we have reproduced to be fixed first, so we can see if the fix helps.
khb Posted - Feb 21 2007 : 02:03:07 AM
Ah, I see. But the option "Parse all headers when opening a project" is always on for me.

Regards,
Marcus.
feline Posted - Feb 20 2007 : 12:59:29 PM
Depending on your settings the files should only be re-parsed if they have changed since last time VA parsed them, e.g. new versions have been checked out from source control.

You may find turning on:

VA Options -> Performance -> General -> Parse all headers when opening a project

helps.
khb Posted - Feb 20 2007 : 02:06:46 AM
Of course, I tried to reparse the header file, too. It doesn't change anything. And I guess that when I restart the IDE and freshly open the workspace that the files I open are automatically reparsed, aren't they?

Regards,
Marcus.
sean Posted - Feb 19 2007 : 2:09:08 PM
Is the instance declared in a header file? If so, you would have to reparse that file instead of where you are using the instance.
khb Posted - Feb 19 2007 : 02:12:11 AM
No, hitting the "Reparse Current File" button doesn't help. I tried it at least 100 times since I faced the problem for the first time, but it didn't change anything.

Regards,
Marcus.
sean Posted - Feb 16 2007 : 9:16:38 PM
Marcus: Regarding the incorrect listbox contents, after pressing ctrl+space and seeing incorrect contents, does invoking a manual reparse have any affect on the list for you? (reparse should be one of the default buttons on the va toolbar)
feline Posted - Feb 16 2007 : 08:33:14 AM
The listbox problem is being looked into, but so far the bug report has not been updated with any further progress. If we don't see anything in a week or two remind me and I will go ask what is happening. I do agree that this is a serious problem.
khb Posted - Feb 16 2007 : 02:02:16 AM
Of course, I can turn it off, but this only means that I don't have to push Ctrl+Space any more. What's more serious is that the suggestions are wrong.

Regards,
Marcus.
feline Posted - Feb 15 2007 : 09:49:30 AM
I have put case=961 (the wrong items in the listbox) down as fairly urgent.

Are you able to turn off Get content from default Intellisense? Or does this cause to many additional problems?
khb Posted - Feb 15 2007 : 02:23:11 AM
Thank you for the summary! So far, I think I'll wait for a fix of the first two problems now. If the remaining problem (only wrong items listed) is then still there, then I will come back for that. Ah, there was one more point: I mentioned the case where even Ctrl+Space stopped working after a dot. I assume that this is nearly impossible to reproduce for you, because it can be a side effect of the remaining problem. But maybe you can note this as a "maybe related" problem. And, please, don't give the cases the lowest priority. The problems are really slowing me down.

Regards,
Marcus.
feline Posted - Feb 14 2007 : 1:28:15 PM
This has got a little confusing, so asking questions is good, *not* dumb

I checked a couple of old versions of VA, including 1301, and all of them have the same "feature" that turning off "Get content from default Intellisense" means you have to press CTRL-SPACE to see a listbox after a dot. This does not seem right to me so I have put in a case for this.

In the test project I sent you a copy of, both me and the developers are seeing the problem with the merged listbox, where the structure items (should be there) are listed along side the other items - which should not be there. There is a case in for this.

I think you are seeing the same behaviour in the test project.

From memory you are only seeing the wrong members in the listboxes in your main code, without this merging effect, which so far I have been unable to reproduce. I am hoping the second case will fix this problem as well for you, but to be honest I don't know if it will or not.

It would nice if I could reproduce this problem (only the wrong items listed), so we can try and fix it, but I am not sure where to start. I had wondered if the "no listbox after dot" problem was related, which was why I tracked it down, but it seems it is not related.

Does this make sense?

*edit to fix typo*
khb Posted - Feb 14 2007 : 09:54:04 AM
Alright. That works. After switching it off, I get the suggestions automatically. But now I'm a bit confused and have to ask some dumb questions again. At first, shouldn't it work also when "Get content from default Intellisense" is turned on? What exactly is the difference when turning that option on/off? And do we still have any open problems or do you see all problems I mentioned so far?

Regards,
Marcus.
feline Posted - Feb 14 2007 : 07:20:28 AM
*doh* a typo on my part, turn Off "Get content from default Intellisense" for the list to appear automatically when you type the dot, turn it on to see this problem.

I could not find any other VA options that had any effect on listboxes not appearing as expected when you type a dot.
khb Posted - Feb 14 2007 : 02:04:18 AM
Uhm, I have the option "Get content from default Intellisense" turned on. This is always on for me. The only option that is not on at

VA Options -> Text Editor -> listboxes

is the lowermost one (List non-inherited members first). Does the settings file say something different?

Regards,
Marcus.
feline Posted - Feb 13 2007 : 11:56:00 AM
I have the registry file, many thanks for that. I am seeing the same effect, where typing dot does not produce a listbox. After a bit of fiddling I have found the cause. Turn on:

VA Options -> Text Editor -> listboxes -> Get content from default Intellisense

When this is turned off you have to press CTRL-SPACE to see the listbox. So this is actually unrelated to the problem with the content of the listboxes.

When "Get content from default Intellisense" is turned on I would have expected VA to respect the option:

VA Options -> Text Editor -> C/C++ 6.0 -> Auto list members

but this is having no effect, so I have put in a case for this:

case=5059
khb Posted - Feb 13 2007 : 08:10:39 AM
I can't access to my private email account right now, so I sent in the settings file via the "Request Assistance" form. I hope you can get it from there.

Regards,
Marcus.
feline Posted - Feb 13 2007 : 07:52:11 AM
I was actually thinking about any class / type, since if there is no information in the HCB then this would suggest that VA is not really parsing your code, so it has nothing to offer when you type the dot. Under these conditions it makes sense to have to press CTRL-SPACE to produce a listbox. However the fact you are seeing information in the HCB seems to rule out this theory.

Can you please export your VA settings:

VA Options -> Performance -> General -> Export Settings

and send me the resulting reg file? This way I can import them here on a test system and see if this makes any difference.

The developers are looking into the wrong items being listed, but since you are still seeing slightly different behaviour to me I am not sure how helpful that fix will be *sigh*
khb Posted - Feb 13 2007 : 02:29:04 AM
Yes, I reinstalled VA. Regarding the HCB, assume I have this line: m_myVec[i].x. If I hover over m_myVec, it is shown in the tree as member of my class, which is correct. I also get a correct tooltip. If I hover over i, then the HCB is empty, but the type of the index i (local variable) is shown in a tooltip. If I hover over ], the HCB is empty again, but the tooltip shows const_reference operator[](size_type _P). BUT: I managed it twice (out of ~50 times) that the []-operator was shown in the HCB. After the first time this happend, pressing Ctrl+Space after the dot stopped working. And if I hover over x, then the HCB doesn't change (previous content is retained) and no tooltip is shown at all.

Regards,
Marcus.
feline Posted - Feb 12 2007 : 08:36:34 AM
Have you reinstalled VA since installing VS2005? I assume you must have, to have VA working inside VS2005.

I am testing on a machine with VC6, VS2003 and VS2005 all installed, the extra IDE's should not matter, at least on paper.

If you turn on VAView does the HCB show the correct information for classes? I am wondering if VA is having more general problems.
khb Posted - Feb 12 2007 : 03:06:42 AM
Yes, VA worked for me very well some time ago. I used VA already for creating the code I now have problems with. I wrote the code last year and touched it last month again. But, another thing has changed since then. I installed VS2005 on my machine, too. So I now have VC6 and VS2005 installed. I have exactly the settings you have. But even then "strName" thing doesn't work for me (I have to always hit Ctrl+Space), neither in my real application nor if I put it in the main function of the test project I received from you.

Regards,
Marcus.
feline Posted - Feb 09 2007 : 08:31:19 AM
Has VA always worked like this for you? So far I cannot reproduce this behaviour.

using VC6 and VA 1544 I have added the two lines:

std::string strName;
strName|


to a function. When I type the dot I always get a completion listbox automatically. This is with:

VA Options -> Text Editor -> C/C++ 6.0 -> Auto list members = ON
VC6 tools menu -> Options -> Editor tab -> Auto list members = OFF

with VA active the IDE option for auto list members has no effect. If I disable VA then this option works as expected. When it is turned off no listbox appears until I press CTRL-SPACE. When it is turned on the listbox appears automatically when I type the dot.

The fact the files are read only should not matter, so long as VA can read them.
khb Posted - Feb 09 2007 : 02:14:52 AM
When I type a dot after a member or local variable, then I never get a suggestion list. But hitting Ctrl+Space always shows the correct list. But I have a member which is a pointer to a struct. If I type a dot, then it is converted to "->" and the correct list is shown. But when I type "->" instead of the dot by myself, then I don't get a suggestion list automatically. And I have an instantiation of a struct that has a constructor. For this variable I don't even get a suggestion list after hitting Ctrl+Space. I removed the constructor, but that didn't help. By the way, the array I'm having the problem with contains a struct that also has a constructor, but this doesn't seem to be the problem. As I already mentioned before, I'm having an MFC application. And my files are write protected due to our version control system. But I guess this shouldn't be the problem, too, because it already worked with the versions before. That are the only differences that come to my mind. Is there anything else I could try?

Regards,
Marcus.
feline Posted - Feb 08 2007 : 11:49:13 AM
Do you normally see a listbox when you type a dot after something? Or do you always have to press CTRL-SPACE to trigger the listbox?

It seems that something is different in your real application, something that so far I have not been able to reproduce.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000