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
 issue with partial namespace qualifiers
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ajburgh
New Member

USA
2 Posts

Posted - Apr 07 2011 :  4:53:01 PM  Show Profile  Reply with Quote
I'm working on code where I constantly run into the following issue. The using directive specifies "System::Collections". The code contains variable declarations that use "Generic::List<String^>" etc. None of the VAssistX completions work on the variables. If the using is changed to "System::Collections::Generic" and the variable declarations to "List<String^>" it works. If the using is left unchanged and the full qualifying name for the variable declaration is used it also works ("System::Collections::Generic::List<String^>")

I'm using VAssistX Build 1842 on VS2010. The project references the following assemblies: System, System.Data, System.Core and System.XML.

Any ideas if I have a setting wrong or if this is a bug in VAssistX?

Abel

Code example (completion works in test2() not in test()):


using namespace System;
using namespace System::Collections;

void test()
{
	Generic::List<String^>^ listTest = gcnew Generic::List<String^>;
	Generic::IEnumerator<String^>^ itTest = listTest->GetEnumerator();

	while (itTest->MoveNext())
	{
		Console::WriteLine(itTest->Current);
	}
}

void test2()
{
	System::Collections::Generic::List<String^>^ listTest = gcnew System::Collections::Generic::List<String^>;
	System::Collections::Generic::IEnumerator<String^>^ itTest = listTest->GetEnumerator();

	while (itTest->MoveNext())
	{
		Console::WriteLine(itTest->Current);
	}
}

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Apr 07 2011 :  7:41:43 PM  Show Profile  Reply with Quote
I am seeing the same effect here. I have put in a bug report for this:

case=56604

Thank you for the clear description and the code snippet.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18950 Posts

Posted - Apr 07 2011 :  11:01:34 PM  Show Profile  Reply with Quote
Adding a 3rd using statement:

using namespace System::Collections::Generic;

also helps for me, so this is another possible work around:

using namespace System;
using namespace System::Collections;
using namespace System::Collections::Generic;

void test3()
{
	List<String^>^ listTest3 = gcnew List<String^>;
	IEnumerator<String^>^ itTest3 = listTest3->GetEnumerator();

	// typing "->" after these two variables produces a listbox
	listTest3;
	itTest3;
}

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

ajburgh
New Member

USA
2 Posts

Posted - Apr 08 2011 :  10:25:02 AM  Show Profile  Reply with Quote
Thanks for putting in the bug report accord.

And thanks for the suggested workaround feline. Unfortunately, adding

"using namespace System::Collections::Generic;" and removing all the "Generic::" qualifiers

without removing

"using namespace System::Collections;"

works for the name completion of VAssistX, but gives "ambiguous symbol" compiler errors on IEnumerator (and also SortedList that is not in the example) since those are defined in both System::Collections and System::Collections::Generic.

This is probably the reason the explicit "Generic::" was originally used since most likely a header file somewhere had a "using namespace System::Collection;" in it.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000