共用方式為


IVsUIShellOpenDocument2.GetDefaultPreviewers Method

Provides a list of Default Previewers. This is the list of previewers that would be launched if IVsUIShellOpenDocument::OpenStandardPreviewer(NULL) is called.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)

Syntax

'宣告
Function GetDefaultPreviewers ( _
    celt As UInteger, _
    <OutAttribute> rgDefaultPreviewers As VSDEFAULTPREVIEWER(), _
    <OutAttribute> ByRef pcActual As UInteger _
) As Integer
'用途
Dim instance As IVsUIShellOpenDocument2
Dim celt As UInteger
Dim rgDefaultPreviewers As VSDEFAULTPREVIEWER()
Dim pcActual As UInteger
Dim returnValue As Integer

returnValue = instance.GetDefaultPreviewers(celt, _
    rgDefaultPreviewers, pcActual)
int GetDefaultPreviewers(
    uint celt,
    VSDEFAULTPREVIEWER[] rgDefaultPreviewers,
    out uint pcActual
)
int GetDefaultPreviewers(
    [InAttribute] unsigned int celt, 
    [OutAttribute] array<VSDEFAULTPREVIEWER>^ rgDefaultPreviewers, 
    [OutAttribute] unsigned int% pcActual
)
abstract GetDefaultPreviewers : 
        celt:uint32 * 
        rgDefaultPreviewers:VSDEFAULTPREVIEWER[] byref * 
        pcActual:uint32 byref -> int 
function GetDefaultPreviewers(
    celt : uint, 
    rgDefaultPreviewers : VSDEFAULTPREVIEWER[], 
    pcActual : uint
) : int

Parameters

  • pcActual
    Type: System.UInt32%
    [Out] A pointer to an unsigned long value. 

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

If celt is zero and pcActual is not NULL, the number of standard previewers is returned in *pcActual. If celt is not zero, rgDefaultPreviewers must not be NULL, or E_POINTER is returned.

A common pattern is something like the following (omitting error checks for readability):

hr = pIVsUIShellOpenDocument2->GetDefaultPreviewers(0, NULL, &cExpected);

prgpDefViewers = ::CoTaskMemAlloc(cExpected * sizeof(VSDEFAULTPREVIEWER));

hr = pIVsUIShellOpenDocument2->GetDefaultPreviewers(cExpected, prgpDefViewers, &cActual);

.NET Framework Security

See Also

Reference

IVsUIShellOpenDocument2 Interface

IVsUIShellOpenDocument2 Members

Microsoft.VisualStudio.Shell.Interop Namespace