Wednesday, March 23, 2011

Is it possible to convert an OCX file to a TLB file for Borland C++?

I'm trying to automate a build, but the instructions require openning an OCX in Borland C++ Builder and saving it as a TLB. How can I reproduce this process through the command line?

From stackoverflow
  • Did you look at the help for the IDE command line or the other tools/executables?

  • If I recall, you can use tlbimport. I will admit it's been a long time, and tlbimport may have been part of the VC++ redist.

  • It's not the nicest solution, but it's the only one I can find that works automatically. I downloaded a free program called AutoHotkey to emulate the keystrokes for openning the ocx file in BCB5, checking off the 'Can Create' checkbox under the Flags tab and saving the file as a tlb. It helps get through the annoying translation warning as well!

  • With Delphi/C++Builder 2009, you can use the TLIBIMP and GENTLB command line tools:

    1. 1. tlibimp -I comdlg32.ocx -Ftcomdlg32
      This will generate a comdlg32.ridl file (RIDL is a variant of Microsoft's IDL).
    2. 2. gentlb comdlg32.ridl
      This generates the comdlg32.tlb file.

0 comments:

Post a Comment