How to import TypeLib as safecall vs stdcall in Delphi 2010

In versions of Delphi until 2010, there was an option in the Delphi environment that could be installed: "All v-table interfaces." This will change the calling convention when importing type libraries. In 2010, this option was gone. How to import type library using safecall calling convention? I hope that in 2010 there will be a more granular level of control than previous versions, but regardless - how do I do it now?

Thanks.

+4
source share
2 answers

I have not tried using the "All v-table interfaces" option in the Delphi 2010 IDE. It was definitely broken in D2009.

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

tlibimp -P -Pt <tlb file> 
+3
source

If you look at the resulting .ridl file that is generated, you will see that the methods have _stdcall.

You now have a finer level of control with .ridl files.

0
source

All Articles