How do I import IDL into Delphi?

How to import a language definition interface file ( idl

) into Delphi ; converting types and interfaces to pascal file?

I tried:

  • File , Open : it just displays the text of the .idl text file
  • Project , Add to Project : it just (acts like) adds a text file .idl

    to the project
  • Component , Install Component , Import Type Library , Add . But it crashes
  • Component , Install Component , Import ActiveX Control , Add . But it crashes li>
  • using the Embarcadero GenTLB : Fails tool (which makes sense since GenTLB doesn't support IDL , only "RIDL"):

    D:\>gentlb d:\develop\avatar\pdb\source\import\CorSym.idl
    Embarcadero GenTLB Version 12.16581
    Copyright(c) 1995-2010 Embarcadero Technologies, Inc.
    
    Opening  'd:\develop\avatar\pdb\source\import\CorSym.idl'
    ***ERRORS*** - 3 errors encountered:
    Error E0001 CorSym.idl 14: 'library' expected, found 'cpp_quote' instead
    Error E0001 CorSym.idl 49: Type keyword expected, found 'const' instead
    Error E0001 CorSym.idl 63: '<EOF>' expected, found 'module' instead
    
          

Reading bonuses

+3


source to share


1 answer


You can use a two step process with the Embarcadero tools:

  • Use gentlb

    to create a type library from an IDL file.
  • Use tlibimp

    to create a Pascal import file from a type library.


I personally use gentlb

to create a type library from a generated .ridl file with the Embarcadero IDE. I believe .ridl is an Embarcadero IDL flavor that is incompatible with the standard MS IDL. If you have MS-flavored IDL you should use the MS IDL compiler to create the type library.

+3


source







All Articles