Delen via


Variant.ToVariant Method

Converts the given variant object to a Variant class object.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)

Syntax

'Declaration
Public Shared Function ToVariant ( _
    ptr As IntPtr _
) As Variant
public static Variant ToVariant(
    IntPtr ptr
)
public:
static Variant ToVariant(
    IntPtr ptr
)
static member ToVariant : 
        ptr:IntPtr -> Variant
public static function ToVariant(
    ptr : IntPtr
) : Variant

Parameters

  • ptr
    Type: IntPtr

    [in] An IntPtr to be marshaled as a variant object.

Return Value

Type: Microsoft.VisualStudio.Package.Variant
If successful, returns a Variant object containing the value of the marshaled variant object; otherwise, returns an empty Variant object.

Remarks

This method is used by the HandlePreExec method on the ViewFilter class to convert the marshaled variant object to a language service-specified Variant object.

.NET Framework Security

See Also

Reference

Variant Structure

Microsoft.VisualStudio.Package Namespace