我有这个测试计划
https://gist.github.com/real-mielofon/5002732
RttiValue := RttiMethod.Invoke(RttiInstance,[10]);
和简单的单位与界面:
unit Unit163; interface type {$M+} ISafeIntf = interface function TestMethod(aI: integer): integer; safecall; end; {$M-} type TSafeClass = class(TInterfacedObject,ISafeIntf) public function TestMethod(aI: integer): integer; safecall; end; implementation function TSafeClass.TestMethod(aI: integer): integer; begin result := aI+1; // Exception !! end; end.
我有kaboom
result := aI+1;
如果是程序或不是safecall,那么没关系:-(