共用方式為


IVsTypeLibraryWrapper.WrapTypeLibrary Method

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Finds or encapsulates wrappers for the requested type library as well as any dependent type libraries.

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

Syntax

'宣告
Function WrapTypeLibrary ( _
    pTypeLibToWrap As TLIBATTR(), _
    wszDestinationDirectory As String, _
    wszKeyFile As String, _
    wszKeyContainer As String, _
    bDelaySign As Integer, _
    pCallback As IVsTypeLibraryWrapperCallback, _
    <OutAttribute> rgbstrWrapperPaths As IntPtr(), _
    <OutAttribute> rgWrappedTypeLibs As IntPtr(), _
    <OutAttribute> rgbGenerated As IntPtr(), _
    <OutAttribute> rgbstrWrapperTools As IntPtr(), _
    <OutAttribute> ByRef pcWrappedTypeLibs As UInteger _
) As Integer
'用途
Dim instance As IVsTypeLibraryWrapper
Dim pTypeLibToWrap As TLIBATTR()
Dim wszDestinationDirectory As String
Dim wszKeyFile As String
Dim wszKeyContainer As String
Dim bDelaySign As Integer
Dim pCallback As IVsTypeLibraryWrapperCallback
Dim rgbstrWrapperPaths As IntPtr()
Dim rgWrappedTypeLibs As IntPtr()
Dim rgbGenerated As IntPtr()
Dim rgbstrWrapperTools As IntPtr()
Dim pcWrappedTypeLibs As UInteger
Dim returnValue As Integer

returnValue = instance.WrapTypeLibrary(pTypeLibToWrap, _
    wszDestinationDirectory, wszKeyFile, _
    wszKeyContainer, bDelaySign, pCallback, _
    rgbstrWrapperPaths, rgWrappedTypeLibs, _
    rgbGenerated, rgbstrWrapperTools, _
    pcWrappedTypeLibs)
int WrapTypeLibrary(
    TLIBATTR[] pTypeLibToWrap,
    string wszDestinationDirectory,
    string wszKeyFile,
    string wszKeyContainer,
    int bDelaySign,
    IVsTypeLibraryWrapperCallback pCallback,
    IntPtr[] rgbstrWrapperPaths,
    IntPtr[] rgWrappedTypeLibs,
    IntPtr[] rgbGenerated,
    IntPtr[] rgbstrWrapperTools,
    out uint pcWrappedTypeLibs
)
int WrapTypeLibrary(
    [InAttribute] array<TLIBATTR>^ pTypeLibToWrap, 
    [InAttribute] String^ wszDestinationDirectory, 
    [InAttribute] String^ wszKeyFile, 
    [InAttribute] String^ wszKeyContainer, 
    [InAttribute] int bDelaySign, 
    [InAttribute] IVsTypeLibraryWrapperCallback^ pCallback, 
    [OutAttribute] array<IntPtr>^ rgbstrWrapperPaths, 
    [OutAttribute] array<IntPtr>^ rgWrappedTypeLibs, 
    [OutAttribute] array<IntPtr>^ rgbGenerated, 
    [OutAttribute] array<IntPtr>^ rgbstrWrapperTools, 
    [OutAttribute] unsigned int% pcWrappedTypeLibs
)
abstract WrapTypeLibrary : 
        pTypeLibToWrap:TLIBATTR[] * 
        wszDestinationDirectory:string * 
        wszKeyFile:string * 
        wszKeyContainer:string * 
        bDelaySign:int * 
        pCallback:IVsTypeLibraryWrapperCallback * 
        rgbstrWrapperPaths:IntPtr[] byref * 
        rgWrappedTypeLibs:IntPtr[] byref * 
        rgbGenerated:IntPtr[] byref * 
        rgbstrWrapperTools:IntPtr[] byref * 
        pcWrappedTypeLibs:uint32 byref -> int 
function WrapTypeLibrary(
    pTypeLibToWrap : TLIBATTR[], 
    wszDestinationDirectory : String, 
    wszKeyFile : String, 
    wszKeyContainer : String, 
    bDelaySign : int, 
    pCallback : IVsTypeLibraryWrapperCallback, 
    rgbstrWrapperPaths : IntPtr[], 
    rgWrappedTypeLibs : IntPtr[], 
    rgbGenerated : IntPtr[], 
    rgbstrWrapperTools : IntPtr[], 
    pcWrappedTypeLibs : uint
) : int

Parameters

  • wszDestinationDirectory
    Type: System.String
    [in] Specifies wszdestination folder.
  • wszKeyContainer
    Type: System.String
    [in] Specifies wszkey container.
  • bDelaySign
    Type: System.Int32
    [in] Byte containing the delay sign.
  • rgbstrWrapperPaths
    Type: array<System.IntPtr[]
    [out] Indicates the type library wrapper path(s).There may be more than one generated wrapper since the method also wraps the dependencies of the type library.
  • rgWrappedTypeLibs
    Type: array<System.IntPtr[]
    [out] Holds a TLIBATTR structure for each wrapped type library. Only the GUID, LCID, and major/minor versions are guaranteed to be set in this structure, the rest of the parameters are zero.
  • rgbGenerated
    Type: array<System.IntPtr[]
    [out] If the wrapper about to be generated already exists on disk and has not expired, the wrapper is not regenerated and corresponding entry in rgbGenerated is set to false. If the wrapper does not exist on disk, rgbGenerated is set to true and the wrapped is generated.
  • rgbstrWrapperTools
    Type: array<System.IntPtr[]
    [out] This array indicates which tool was used for each returned wrapper. The possible return values are "Tlbimp", "Aximp", and "Primary".
  • pcWrappedTypeLibs
    Type: System.UInt32%
    [out] Pointer to the size of wrapped type libraries.

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 IVsTypeLibraryWrapper::WrapTypeLibrary(
   [in] TLIBATTR* pTypeLibToWrap,
   [in] LPCOLESTR wszDestinationDirectory,
   [in] LPCOLESTR wszKeyFile,
   [in] LPCOLESTR wszKeyContainer,
   [in] BOOL bDelaySign,
   [in] IVsTypeLibraryWrapperCallback* pCallback,
   [out] BSTR** rgbstrWrapperPaths,
   [out] TLIBATTR** rgWrappedTypeLibs,
   [out] BOOL** rgbGenerated,
   [out] BSTR** rgbstrWrapperTools,
   [out] ULONG* pcWrappedTypeLibs
);

The ith element in rgbstrWrapperPaths corresponds to the ith element in rgWrapperTypeLibs, rgbGenerated, and corresponding entry in rgbstrWrapperTools. Never assume that first element in each of the above arrays corresponds to the type library you requested to be wrapped.

.NET Framework Security

See Also

Reference

IVsTypeLibraryWrapper Interface

IVsTypeLibraryWrapper Members

Microsoft.VisualStudio.Shell.Interop Namespace