VsShellUtilities::TryOpenDocument Method (IServiceProvider^, String^, Guid, IVsUIHierarchy^, UInt32, IVsWindowFrame^)

 

Tries to open a document using the appropriate project.

Namespace:   Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)

public:
static int TryOpenDocument(
	IServiceProvider^ provider,
	String^ fullPath,
	Guid logicalView,
	[OutAttribute] IVsUIHierarchy^% hierarchy,
	[OutAttribute] unsigned int% itemID,
	[OutAttribute] IVsWindowFrame^% windowFrame
)

Parameters

provider
Type: System::IServiceProvider^

The service provider.

fullPath
Type: System::String^

The full path to the document.

logicalView
Type: System::Guid

The GUID of the logical view.

hierarchy
Type: Microsoft.VisualStudio.Shell.Interop::IVsUIHierarchy^

The T:Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy interface of the project that contains the document to open.

itemID
Type: System::UInt32

The hierarchy item identifier of the document in the project.

windowFrame
Type: Microsoft.VisualStudio.Shell.Interop::IVsWindowFrame^

Te window frame that is mapped to the document.

Return Value

Type: System::Int32

VsConstants.S_OK if successful, otherwise a failure code.

Return to top
Show: