2 bugs (?) with ClassView in VC++ 5.0 
Author Message
 2 bugs (?) with ClassView in VC++ 5.0

I didn't find either of these listed in the KB...  These pertain to
VC++ 5.0

1) The "explicit" keyword seems to prevent constructors from appearing in
the classview window.

2) If a class is defined within a namespace, the ClassView can't find the
corresponding functions.

The following code compiles OK (it doesn't link, 'cuz it's not complete),
and it demonstrates both of these problems:

#include <string.h>

namespace foo
{
   class test
   {
   public:
      test(void);
      test(const test&);
      explicit test(const char*);
      ~test(void);

      test& operator=(const test&);
   private:
      char* m_sz;
   };

Quote:
}

foo::test::test (void)
: m_sz(0)
{

Quote:
}

foo::test::test(const foo::test& x)
{
   m_sz = new char[strlen(x.m_sz)];
   strcpy(m_sz, x.m_sz);

Quote:
}

foo::test::test(const char* sz)
: m_sz(strdup(sz))
{
   m_sz = new char[strlen(sz)];
   strcpy(m_sz, sz);

Quote:
}

foo::test::~test (void)
{
   delete[] m_sz;

Quote:
}

foo::test& foo::test::operator= (const foo::test& x)
{
   if (&x != this)
   {
      delete[] m_sz;
      m_sz = new char[strlen(x.m_sz)];
      strcpy(m_sz, x.m_sz);
   }
   return *this;

Quote:
}

The const char* conversion doesn't show up in ClassView, and if you
double-click on any of the other functions in ClassView, it tells you that
it can't find the function.

If you remove the namespace stuff, this works fine.

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
John W. Wismar                           Synergex
Systems Programmer                Synergy/FE team

The opinions expressed here are my own, and
should not be inferred to represent any policy,
opinion or communication from Synergex.

My reply-to address has been altered to limit spam.



Mon, 15 Nov 1999 03:00:00 GMT  
 2 bugs (?) with ClassView in VC++ 5.0

I didn't find either of these listed in the KB...  These pertain to
VC++ 5.0

1) The "explicit" keyword seems to prevent constructors from appearing in
the classview window.

2) If a class is defined within a namespace, the ClassView can't find the
corresponding functions.

The following code compiles OK (it doesn't link, 'cuz it's not complete),
and it demonstrates both of these problems:

#include <string.h>

namespace foo
{
   class test
   {
   public:
      test(void);
      test(const test&);
      explicit test(const char*);
      ~test(void);

      test& operator=(const test&);
   private:
      char* m_sz;
   };

Quote:
}

foo::test::test (void)
: m_sz(0)
{

Quote:
}

foo::test::test(const foo::test& x)
{
   m_sz = new char[strlen(x.m_sz)];
   strcpy(m_sz, x.m_sz);

Quote:
}

foo::test::test(const char* sz)
: m_sz(strdup(sz))
{
   m_sz = new char[strlen(sz)];
   strcpy(m_sz, sz);

Quote:
}

foo::test::~test (void)
{
   delete[] m_sz;

Quote:
}

foo::test& foo::test::operator= (const foo::test& x)
{
   if (&x != this)
   {
      delete[] m_sz;
      m_sz = new char[strlen(x.m_sz)];
      strcpy(m_sz, x.m_sz);
   }
   return *this;

Quote:
}

The const char* conversion doesn't show up in ClassView, and if you
double-click on any of the other functions in ClassView, it tells you that
it can't find the function.

If you remove the namespace stuff, this works fine.

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
John W. Wismar                           Synergex
Systems Programmer                Synergy/FE team

The opinions expressed here are my own, and
should not be inferred to represent any policy,
opinion or communication from Synergex.

My reply-to address has been altered to limit spam.



Mon, 15 Nov 1999 03:00:00 GMT  
 2 bugs (?) with ClassView in VC++ 5.0

The namespace thing is a known problem, documented in
http://www.microsoft.com/kb/articles/q140/4/39.htm

The explicit problem is probably a result of the same type of thing, but
you may want to report it to MS at
http://www.microsoft.com/VisualCSupport/report/  (note MS will not
respond to your bug report)
--
Its a big enough umbrella,
                But its always me that ends up getting wet....



Mon, 15 Nov 1999 03:00:00 GMT  
 2 bugs (?) with ClassView in VC++ 5.0

The preprocessor isn't invoked when scanning dependencies (or when the
classview stuff is built), so it make complete sense that your code
would confuse Classview



Tue, 16 Nov 1999 03:00:00 GMT  
 2 bugs (?) with ClassView in VC++ 5.0

I missed the first message that started this thread.

I have a problem with Class View

When I create a project with the MFC DLL wizard, I get a class view for
my C++ classes, but if I create a project that is a simple 32-bit
Windows DLL, I don't get a class view for my C++ classes.  Only the
global functions appear.

Also, in the File View, the header files appear in External
Dependencies, not in the Header Files folder.

Any ideas why this is?

Dave Pomerantz
On Target Software

Quote:


> >The namespace thing is a known problem, documented in
> >http://www.microsoft.com/kb/articles/q140/4/39.htm

> Actually, that's a different bug.  That one refers to VC 4.x and says
> that
> classes don't show up at all if in a namespace.

> With the bug I'm referring to, in VC5, the class shows up fine, but
> ClassView can't locate the method definitions when you try to use the
> ClassView to go to their implementation code.

> --
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> John W. Wismar                           Synergex
> Systems Programmer                Synergy/FE team

> The opinions expressed here are my own, and
> should not be inferred to represent any policy,
> opinion or communication from Synergex.

> My reply-to address has been altered to limit spam.



Sat, 20 Nov 1999 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. ClassView doesn't show classes in my VC++ 5.0

2. ClassView in VC 5.0 doesn't show my classes

3. VC++ 5.0 slow at processing ClassView??

4. Slow ClassView - much slower than in VC++ 5.0

5. Small namespace/classview bug in VC.NET?

6. bug in vc++ 5.0 using std::string

7. vc++ 5.0 bug in <deque>

8. VC++ 5.0 BUG: const variable has external link.

9. GOT VC 5.0 BUGS???

10. VC 5.0 and 6.0 Debugger Bug

11. VC++ 5.0 debugger bug?

12. GOT VC 5.0 BUGS???

 

 
Powered by phpBB® Forum Software