如何用DELPHI将.idl文件编译为delphi的兼容文件(.pas或 .tlb)

解决方案 »

  1.   

    操作系统提供了ICreateTypeLib(2),ICreateTypeInfo(2)这两个接口来将IDL文件编译成TLB文件
      

  2.   

    《INSIDE COM+ BASE SERVICES》这本书的第三章-----Type Libraries 里面有这样一段话,你可以参考一下:
    Microsoft has defined the COM+ interfaces for building type libraries—ICreateTypeLib(2) and ICreateTypeInfo(2)—and for reading type libraries—ITypeLib(2) and ITypeInfo(2). Microsoft also provides a standard implementation of these interfaces that is available to all applications as part of the system file oleaut32.dll.
    While you can build a type library manually using the system implementations of the ICreateTypeLib(2) and ICreateTypeInfo(2) interfaces, it is much easier to use the MIDL compiler.