Partager via


ISelectionContainer.CountObjects Method

Returns either a count of the total number of objects available or a count of the objects in the current selection.

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

Syntax

'Declaration
Function CountObjects ( _
    dwFlags As UInteger, _
    <OutAttribute> ByRef pc As UInteger _
) As Integer
int CountObjects(
    uint dwFlags,
    out uint pc
)
int CountObjects(
    [InAttribute] unsigned int dwFlags, 
    [OutAttribute] unsigned int% pc
)
abstract CountObjects : 
        dwFlags:uint32 * 
        pc:uint32 byref -> int
function CountObjects(
    dwFlags : uint, 
    pc : uint
) : int

Parameters

  • dwFlags
    Type: UInt32

    [in] Flag that specifies which type of count to return. If set to GETOBJS_ALL, CountObjects returns the total number of objects. If set to GETOBJS_SELECTED, CountObjects returns the number of selected objects.

  • pc
    Type: UInt32%

    [out] Pointer to the requested object count.

Return Value

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

Remarks

COM Signature

From designer.idl:

HRESULT ISelectionContainer::CountObjects(
   [in] DWORD dwFlags,
   [out] ULONG * pc
);

Many windows support only single item selection; they do not allow multiple items to be selected at any one time. Single selection windows always return one for their object count regardless of how dwFlags is set.

.NET Framework Security

See Also

Reference

ISelectionContainer Interface

Microsoft.VisualStudio.Shell.Interop Namespace