zoukankan      html  css  js  c++  java
  • 再论Type Library Importer (Tlbimp.exe)

    The Type Library Importer converts the type definitions found within a COM type library into equivalent definitions in a common language runtime assembly. The output of Tlbimp.exe is a binary file (an assembly) that contains runtime metadata for the types defined within the original type library. You can examine this file with tools such as Ildasm.exe.

    tlbimp tlbFile [options]

    Argument

    Description

    tlbFile

    The name of any file that contains a COM type library.

     Examples

    The following command generates an assembly with the same name as the type library found in myTest.tlb and with the .dll extension.

    tlbimp myTest.tlb 
    

    The following command generates an assembly with the name myTest.dll.

    tlbimp  myTest.tlb  /out:myTest.dll
    

    The following command generates an assembly with the same name as the type library specified by MyModule.dll\1 and with the .dll extension. MyModule.dll\1 must be located in the current directory.

    tlbimp MyModule.dll\1
    

    The following command generates an assembly with the name myTestLib.dll for the type library TestLib.dll. The /transform:dispret option transforms any [out, retval] parameters of methods on dispinterfaces in the type library into return values in the managed library.

    tlbimp TestLib.dll /transform:dispret /out:myTestLib.dll
    

    The type library TestLib.dll, in the preceding example, includes a dispinterface method named SomeMethod that returns void and has an [out, retval] parameter. The following code is the input type library method signature for SomeMethod in TestLib.dll.

    void SomeMethod([out, retval] VARIANT_BOOL*);
    

    Specifying the /transform:dispret option causes Tlbimp.exe to transform the [out, retval] parameter of SomeMethod into a bool return value. The following is the method signature that Tlbimp.exe produces for SomeMethod in the managed library myTestLib.dll when the /transform:dispret option is specified.

    C#
     
    bool SomeMethod();

    If you use Tlbimp.exe to produce a managed library for TestLib.dll without specifying the /transform:dispret, the tool produces the following method signature for SomeMethod in the managed library myTestLib.dll.

    void SomeMethod(out bool x);

  • 相关阅读:
    C# WPF透明黑色样式窗口
    ExtJS速学
    编译away3d例程序记
    用VC加载Lua.lib,C++调用lua脚本函数
    mysql数据库备份
    Google TTS(文字转语音)api 2
    C Sharp Coding Standards
    微信公众平台功能大杂烩 ip/域名查询 车牌号归属地查询 手机归属地查询 公交查询 英汉互译
    google jsapi学习记录
    Google TTS(文字转语音)api
  • 原文地址:https://www.cnblogs.com/MayGarden/p/1714638.html
Copyright © 2011-2022 走看看