How do I Import TypeLib as safecall vs stdcall in Delphi 2010
Delphi versions b开发者_StackOverflow中文版efore 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.
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>
If you look at the resulting .ridl file that is generated, you will see that the methods have _stdcall defined.
You have a finer level of control using the .ridl files now.
精彩评论