Export (0) Print
Expand All

IVsSolution.CloseSolutionElement Method

Programmatically closes a document, a project, or the entire solution.

Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in microsoft.visualstudio.shell.interop.dll)

int CloseSolutionElement (
	[InAttribute] uint grfCloseOpts,
	[InAttribute] IVsHierarchy pHier,
	[InAttribute] uint docCookie
)
int CloseSolutionElement (
	/** @attribute InAttribute() */ UInt32 grfCloseOpts, 
	/** @attribute InAttribute() */ IVsHierarchy pHier, 
	/** @attribute InAttribute() */ UInt32 docCookie
)
function CloseSolutionElement (
	grfCloseOpts : uint, 
	pHier : IVsHierarchy, 
	docCookie : uint
) : int

Parameters

grfCloseOpts

[in] Close options for the solution (.sln) file. For a list of grfCloseOpts values, see __VSSLNCLOSEOPTIONS.

pHier

[in] Pointer to the IVsHierarchy interface of the document to close.

docCookie

[in] Document that was closed. This value is returned from the running document table, by calling GetDocumentInfo.

Return Value

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

COM Signature

From vsshell.idl:

HRESULT IVsSolution::CloseSolutionElement(
   [in] VSSLNCLOSEOPTIONS grfCloseOpts,
   [in] IVsHierarchy *pHier,
   [in] VSCOOKIE docCookie
);

To close the entire solution, call CloseSolutionElement(grfCloseOpts, a null reference (Nothing in Visual Basic), a null reference (Nothing in Visual Basic)). To close a single project, call CloseSolutionElement(grfCloseOpts, phier, a null reference (Nothing in Visual Basic)). To close a single document, call CloseSolutionElement(grfCloseOpts, a null reference (Nothing in Visual Basic), docCookie).

Community Additions

ADD
Show:
© 2014 Microsoft