C
Chris Bearchell
I am trying to get browse information for a VS.net 2003 C++ project,
however I am running into trouble resolving methods within a
namespace. From within the object browser, all methods within a class
report "No references available for this item" when the class is
within a namespace. If I remove the namespace, then VS is able to
resolve the references correctly. This problem does not affect member
variables.
The following code exhibits the problem (generated from a default
console app with browse information enabled):
namespace test
{
class TestClass
{
public:
TestClass(){}
~TestClass(){}
void TestMethod(){}
public:
bool testVariable;
};
}
using namespace test;
int _tmain(int argc, _TCHAR* argv[])
{
TestClass test;
test.TestMethod();
test.testVariable = true;
return 0;
}
In this case TestMethod() reports no references available whilst
testVariable correctly identifies the line test.testVariable = true;.
Removing the namespace resolves the problem entirely.
I suspect that this is a bug in VS.net 2003. I noticed this thread:
http://groups.google.com/[email protected]&rnum=1
which suggests this is a known issue that was being worked on. It also
suggests that the issue was to be fixed in a future release (this
thread was November 2002) and I was wondering whether this should have
been addressed for VC 7.1.
Many thanks,
Chris
however I am running into trouble resolving methods within a
namespace. From within the object browser, all methods within a class
report "No references available for this item" when the class is
within a namespace. If I remove the namespace, then VS is able to
resolve the references correctly. This problem does not affect member
variables.
The following code exhibits the problem (generated from a default
console app with browse information enabled):
namespace test
{
class TestClass
{
public:
TestClass(){}
~TestClass(){}
void TestMethod(){}
public:
bool testVariable;
};
}
using namespace test;
int _tmain(int argc, _TCHAR* argv[])
{
TestClass test;
test.TestMethod();
test.testVariable = true;
return 0;
}
In this case TestMethod() reports no references available whilst
testVariable correctly identifies the line test.testVariable = true;.
Removing the namespace resolves the problem entirely.
I suspect that this is a bug in VS.net 2003. I noticed this thread:
http://groups.google.com/[email protected]&rnum=1
which suggests this is a known issue that was being worked on. It also
suggests that the issue was to be fixed in a future release (this
thread was November 2002) and I was wondering whether this should have
been addressed for VC 7.1.
Many thanks,
Chris