i've an add-in to document classes in XML style, i'm trying to determine
the type of a CodeElement as follows:
Dim fcmFileCodeModel As FileCodeModel =
DTE.ActiveDocument.ProjectItem.FileCodeModel
Dim editPoint As EditPoint =
DTE.ActiveDocument.Selection.TopPoint.CreateEditPoint()
Dim ceElement as CodeElement =
editPoint.CodeElement(vsCMElement.vsCMElementProperty)
on the previous line i get the error:
editPoint.CodeElement(EnvDTE.vsCMElement.vsCMElementProperty)
Overload resolution failed because no accessible 'CodeElement' is most
specific for these arguments:
'Public Overridable ReadOnly Property CodeElement(Scope As
EnvDTE.vsCMElement) As EnvDTE.CodeElement': Not most specific.
'Public Overridable ReadOnly Property CodeElement(Scope As
EnvDTE.vsCMElement) As EnvDTE.CodeElement': Not most specific.
and when i try to use the FileCodeModel object:
ceElement =
fcmFileCodeModel.CodeElementFromPoint(DTE.ActiveDocument.Selection.Activ\
ePoint, vsCMElement.vsCMElementProperty)
i get the following exception:
fcmFileCodeModel.CodeElementFromPoint(editPoint,
vsCMElement.vsCMElementProperty) Run-time exception thrown :
System.Runtime.InteropServices.COMException - Unspecified error
And strange enough it works fine with Classes & Functions , What is
missing??
[Non-text portions of this message have been removed]