Esempio n. 1
0
        /// <summary>
        /// Provides access to a configuration interfaces such as <see cref="T:Microsoft.VisualStudio.Shell.Interop.IVsBuildableProjectCfg2"/> or <see cref="T:Microsoft.VisualStudio.Shell.Interop.IVsDebuggableProjectCfg"/>.
        /// </summary>
        /// <returns>
        /// If the method succeeds, it returns <see cref="F:Microsoft.VisualStudio.VSConstants.S_OK"/>. If it fails, it returns an error code.
        /// </returns>
        /// <param name="iidCfg">[in] Interface identifier of the <paramref name="ppCfg"/> to access.</param><param name="ppCfg">[out, iid_is(iidCfg)] Pointer to the configuration interface identified by <paramref name="iidCfg"/>.</param>
        public int get_CfgType(ref Guid iidCfg, out IntPtr ppCfg)
        {
            ppCfg = IntPtr.Zero;

            // See if this is an interface we support
            if (iidCfg == typeof(IVsDebuggableProjectCfg).GUID)
            {
                var projectCfg = new DebuggableProjectCfg(project);
                ppCfg = Marshal.GetComInterfaceForObject(projectCfg, typeof (IVsDebuggableProjectCfg));
            }

            // If not supported
            return (ppCfg == IntPtr.Zero) ? VSConstants.E_NOINTERFACE : VSConstants.S_OK;
        }
Esempio n. 2
0
        /// <summary>
        /// Provides access to a configuration interfaces such as <see cref="T:Microsoft.VisualStudio.Shell.Interop.IVsBuildableProjectCfg2"/> or <see cref="T:Microsoft.VisualStudio.Shell.Interop.IVsDebuggableProjectCfg"/>.
        /// </summary>
        /// <returns>
        /// If the method succeeds, it returns <see cref="F:Microsoft.VisualStudio.VSConstants.S_OK"/>. If it fails, it returns an error code.
        /// </returns>
        /// <param name="iidCfg">[in] Interface identifier of the <paramref name="ppCfg"/> to access.</param><param name="ppCfg">[out, iid_is(iidCfg)] Pointer to the configuration interface identified by <paramref name="iidCfg"/>.</param>
        public int get_CfgType(ref Guid iidCfg, out IntPtr ppCfg)
        {
            ppCfg = IntPtr.Zero;

            // See if this is an interface we support
            if (iidCfg == typeof(IVsDebuggableProjectCfg).GUID)
            {
                var projectCfg = new DebuggableProjectCfg(project);
                ppCfg = Marshal.GetComInterfaceForObject(projectCfg, typeof(IVsDebuggableProjectCfg));
            }

            // If not supported
            return((ppCfg == IntPtr.Zero) ? VSConstants.E_NOINTERFACE : VSConstants.S_OK);
        }