创建扩展类型库并返回引用计数 (AddRef) 接口访问它。
命名空间: Microsoft.VisualStudio.Shell.Interop
程序集: Microsoft.VisualStudio.Shell.Interop(在 Microsoft.VisualStudio.Shell.Interop.dll 中)
语法
声明
Function AddRefExtendedTypeLib ( _
lpstrCtrlLibFileName As String, _
lpstrLibNamePrepend As String, _
ptinfoExtender As Type, _
dwReserved As UInteger, _
dwFlags As UInteger, _
lpstrDirectoryName As String, _
<OutAttribute> ByRef pptLib As ITypeLib _
) As Integer
int AddRefExtendedTypeLib(
string lpstrCtrlLibFileName,
string lpstrLibNamePrepend,
Type ptinfoExtender,
uint dwReserved,
uint dwFlags,
string lpstrDirectoryName,
out ITypeLib pptLib
)
参数
- lpstrCtrlLibFileName
类型:System.String
[in] 对包含类型库文件名的字符串的指针。这是一个类型为的库扩展。
使用 QueryPathOfRegTypeLib,您可以获取一个类型库和其他信息的名称以其 GUID 的。
- lpstrLibNamePrepend
类型:System.String
[in] 对前面添加的字符串的指针扩展的类型库的文件名。
- ptinfoExtender
类型:System.Type
[in] 以扩展程序使用的 ITypeInfo 的指针。
- dwReserved
类型:System.UInt32
[in] 未使用的值。使用零 (0)。
- dwFlags
类型:System.UInt32
[in] 未使用的值。使用零 (0)。
- lpstrDirectoryName
类型:System.String
[in] 对包含完整路径的字符串的指针写出扩展的类型库。使用 null 值,如果不保存库。
- pptLib
类型:Microsoft.VisualStudio.OLE.Interop.ITypeLib%
[out] 对扩展 (合并的) 类型库的 ITypeLib 的指针。
返回值
类型:System.Int32
如果方法成功,则返回 S_OK。如果失败,它会返回一个错误代码。
备注
COM 签名
从 objext.idl:
[C++]
HRESULT IExtendedTypeLib::AddRefExtendedTypeLib(
[in] LPCOLESTR lpstrCtrlLibFileName,
[in] LPCOLESTR lpstrLibNamePrepend,
[in] ITypeInfo* ptinfoExtender,
[in] DWORD dwReserved,
[in] DWORD dwFlags,
[in] LPCOLESTR lpstrDirectoryName,
[out] ITypeLib** pptLib
);
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。