Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
tools
vsnet.act
vsnet.debugging
vsnet.documentation
vsnet.enterprise.tools
vsnet.general
vsnet.ide
vsnet.jlca
vsnet.servicepacks
vsnet.setup
vsnet.vsip
vsnet.vss
vsnet.vstools.office
vstudio.development
vstudio.extensibility
vstudio.general
vstudio.helpauthoring
vstudio.setup
vstudio.sourcesafe
  
 
date: Thu, 31 Jan 2008 08:46:28 -0800 (PST),    group: microsoft.public.vstudio.extensibility        back       


How to determine the type of the current project   
Im migrating an Addin to vs 2008.  The addin is only active if the
current project is a C++ project.

The current code tries to detect this with the following

        Dim proj As VCProject = Nothing
        Dim projects As System.Array

        Try

            projects = CType(Connect.oVB.DTE.ActiveSolutionProjects(),
System.Array)
            If projects.Length > 0 Then
                Dim prj As Project = CType(projects.GetValue(0),
EnvDTE.Project)
                proj = CType(prj, VCProject)
            End If

        Catch ex As Exception
               Return Nothing
        End Try

The following exception is then thrown  when trying to cast a valid
Project object to a VCProject.
I can assure you the current project is C++.


Unable to cast COM object of type 'System.__ComObject' to interface
type 'Microsoft.VisualStudio.VCProjectEngine.VCProject'. This
operation failed because the QueryInterface call on the COM component
for the interface with IID '{238B5174-2429-11D7-8BF6-00B0D03DAA06}'
failed due to the following error: No such interface supported
(Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).


Any suggestions would be greatly appreciated?
date: Thu, 31 Jan 2008 08:46:28 -0800 (PST)   author:   Herby

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us