Share via


IVsShell.LoadPackageString Method

Directly loads a localized string from a VSPackage satellite DLL.

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

Syntax

'Declaration
Function LoadPackageString ( _
    ByRef guidPackage As Guid, _
    resid As UInteger, _
    <OutAttribute> ByRef pbstrOut As String _
) As Integer
int LoadPackageString(
    ref Guid guidPackage,
    uint resid,
    out string pbstrOut
)
int LoadPackageString(
    [InAttribute] Guid% guidPackage, 
    [InAttribute] unsigned int resid, 
    [OutAttribute] String^% pbstrOut
)
abstract LoadPackageString : 
        guidPackage:Guid byref * 
        resid:uint32 * 
        pbstrOut:string byref -> int
function LoadPackageString(
    guidPackage : Guid, 
    resid : uint, 
    pbstrOut : String
) : int

Parameters

  • guidPackage
    Type: Guid%

    [in] Unique identifier of the VSPackage whose UI DLL contains the string specified to load.

  • resid
    Type: UInt32

    [in] Identifier of the string table resource.

  • pbstrOut
    Type: String%

    [out, retval] Pointer to the requested string.

Return Value

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsShell::LoadPackageString(
   [in] REFGUID guidPackage,
   [in] ULONG resid,
   [out, retval] BSTR *pbstrOut
);

This method is a helper utility — a shortcut for calling the LoadUILibrary LoadResourceString. The Win API caller is responsible for calling SysFreeString to free the allocated pbstrOut string. This method uses the LoadUILibrary method to load the localized string as a string resource. You can also manually load the string resource.

.NET Framework Security

See Also

Reference

IVsShell Interface

Microsoft.VisualStudio.Shell.Interop Namespace