0
我在VB写的宏为Visual Studio:参考非共享成员需要的对象引用
Imports EnvDTE
Imports EnvDTE80
Imports Microsoft.VisualBasic
Public Class C
Implements VisualCommanderExt.ICommand
Sub Run(DTE As EnvDTE80.DTE2, package As Microsoft.VisualStudio.Shell.Package) Implements VisualCommanderExt.ICommand.Run
FileNamesExample()
End Sub
Sub FileNamesExample()
Dim proj As Project
Dim projitems As ProjectItems
' Reference the current solution and its projects and project items.
proj = DTE.ActiveSolutionProjects(0)
projitems = proj.ProjectItems
' List the file name associated with the first project item.
MsgBox(projitems.Item(1).FileNames(1))
End Sub
End Class
我编译之后得到这个:
错误(17,0):错误BC30469:对非共享成员的引用需要对象引用。
你有什么想法是什么错?我之前没有在VB中开发,我只需要即时帮助。