Ver versión en español    
 
Home
10 Reasons to use MZ-Tools
MZ-Tools 6.0 for VS.NET
Editions
Features
Online Documentation
MZ-Tools SDK
Download
Purchase
Version History (RSS)  
FAQ & Support
MZ-Tools 3.0 for VB6 & VBA
Features
Online Documentation
Download (freeware)
Donations (Paypal)
Version History (RSS)  
FAQ & Support
User Reviews
Community Place
Contact  
For Add-In Developers
About
   
 
User Testimonials

I'm an avid supporter of MZ-Tools. It's a product I couldn't do without and your level of support is outstanding.

Jan Hyde (Visual Basic MVP)

You will soon wonder how you ever lived without it.

Andy Maggs

More user reviews
 
BUG: EnvDTE.CodeElement.GetStartPoint(vsCMPart.vsCMPartBody) returns wrong result for VB.NET classes using the Implements or Inherits clauses

Author: Carlos J. Quintero (Microsoft MVP) Applies to: Microsoft Visual Studio 2005
Date: July 2009   Microsoft Visual Studio 2008

Introduction

When a class created in a VB.NET project uses the Implements or Inherits clauses, the EnvDTE.CodeElement.GetStartPoint method returns a wrong result when using vsCMPart.vsCMPartBody.

More Information

Steps to reproduce the problem:

  • Create a class with this code:
Language: VB.NET   Copy Code Copy Code (IE only)
1 Public Class C1
2    Public Event Event1()
3 End Class
4
5 Public Class C2
6    Inherits System.Object
7    Public Event Event1()
8 End Class
  • Create and execute this macro:
Language: VB.NET   Copy Code Copy Code (IE only)
Sub Macro1()

   Dim codeElement As CodeElement

   For Each codeElement In DTE.ActiveDocument.ProjectItem.FileCodeModel.CodeElements
      MsgBox(codeElement.Name & ": " & codeElement.GetStartPoint(vsCMPart.vsCMPartBody).Line)
   Next

End Sub

For the first class the result line is 2 (correct) but for the second class the result line is 8 when it should be 7. This is a bug of Visual Studio 2005 and 2008. It didn't happen in Visual Studio .NET 2003.


Go back to the 'Resources for Visual Studio .NET extensibility' section for more articles like this


MZ-Tools 6.0 for Visual Studio .NET

You can code, design, locate code and document your apps much faster using VB.NET, C#, C++ or Visual J#:

Buy MZ-Tools Now Download MZ-Tools Demo

   Top