IVsHTMLConverter.ConvertToURLEncoding Method

Converts a string substituting URL encoding where needed, such as "%20" for a space.

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

Syntax

'宣言
Function ConvertToURLEncoding ( _
    uCodePage As UInteger, _
    szToConvert As String, _
    cchBuffSize As UInteger, _
    <OutAttribute> szBuffer As UShort(), _
    <OutAttribute> ByRef pcchBuffSizeActual As UInteger _
) As Integer
'使用
Dim instance As IVsHTMLConverter
Dim uCodePage As UInteger
Dim szToConvert As String
Dim cchBuffSize As UInteger
Dim szBuffer As UShort()
Dim pcchBuffSizeActual As UInteger
Dim returnValue As Integer

returnValue = instance.ConvertToURLEncoding(uCodePage, _
    szToConvert, cchBuffSize, szBuffer, _
    pcchBuffSizeActual)
int ConvertToURLEncoding(
    uint uCodePage,
    string szToConvert,
    uint cchBuffSize,
    ushort[] szBuffer,
    out uint pcchBuffSizeActual
)
int ConvertToURLEncoding(
    [InAttribute] unsigned int uCodePage, 
    [InAttribute] String^ szToConvert, 
    [InAttribute] unsigned int cchBuffSize, 
    [OutAttribute] array<unsigned short>^ szBuffer, 
    [OutAttribute] unsigned int% pcchBuffSizeActual
)
function ConvertToURLEncoding(
    uCodePage : uint, 
    szToConvert : String, 
    cchBuffSize : uint, 
    szBuffer : ushort[], 
    pcchBuffSizeActual : uint
) : int

Parameters

  • uCodePage
    Type: System.UInt32

    [in] The code page to use when converting.

  • cchBuffSize
    Type: System.UInt32

    [in] Length of the buffer in which to store the converted string.

  • szBuffer
    Type: []

    [out] The buffer containing the converted string.

  • pcchBuffSizeActual
    Type: System.UInt32%

    [out] Actual size of the buffer used.

Return Value

Type: System.Int32

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsHTMLConverter::ConvertToURLEncoding(
   [in] UINT uCodePage, 
   [in] LPCOLESTR szToConvert, 
   [in] ULONG cchBuffSize, 
   [in, out, size_is(cchBuffSize)] OLECHAR szBuffer[], 
   [out] ULONG *pcchBuffSizeActual
);

Permissions

See Also

Reference

IVsHTMLConverter Interface

IVsHTMLConverter Members

Microsoft.VisualStudio.Shell.Interop Namespace