Search code examples
delphidelphi-2010typelib

How do I Import TypeLib as safecall vs stdcall in Delphi 2010


Delphi versions before 2010 had an option in the Delphi Environment that one could set: "All v-table interfaces". This would change the calling convention when importing type libraries. In 2010, the option is gone. How do I import a type library with the safecall calling convention? I'm hoping maybe there is a more granular level of control in 2010 than previous versions, but regardless - how do I do this now?

Thanks.


Solution

  • I haven't tried using the "All v-table interfaces" option in the Delphi 2010 IDE. It was definitely broken in D2009.

    You can use the command-line tlibimp tool to create the _tlb.pas files you need:

    tlibimp -P -Pt <tlb file>