IVsSolution.SaveSolutionElement(UInt32, IVsHierarchy, UInt32) Method

Definition

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

C++/CX
public:
 int SaveSolutionElement(unsigned int grfSaveOpts, Microsoft::VisualStudio::Shell::Interop::IVsHierarchy ^ pHier, unsigned int docCookie);

Parameters

grfSaveOpts
UInt32

[in] Save Options. For a list of grfSaveOpts, see __VSSLNSAVEOPTIONS.

pHier
IVsHierarchy

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

docCookie
UInt32

[in] Abstract handle to the element that was saved.

Returns

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

Remarks

COM Signature

From vsshell.idl:

cpp#
HRESULT IVsSolution::SaveSolutionElement(  
   [in] VSSLNSAVEOPTIONS grfSaveOpts,  
   [in] IVsHierarchy *pHier,  
   [in] VSCOOKIE docCookie  
);  

To save the entire solution, call SaveSolutionElement(grfSaveOpts, null, null). To save a single project, call SaveSolutionElement(grfSaveOpts, phier, null). To save a single document, call SaveSolutionElement(grfSaveOpts, null, docCookie).

Applies to

製品 バージョン
Visual Studio SDK 2015, 2017, 2019, 2022