我有一个项目,其中大量源代码不可用。其中一个函数存在 IntfCast 异常,我一直在使用 CPU 调试器逐步执行应用程序,并确定了包含强制转换操作的函数和所涉及的类之一,但我无法识别另一个类。我正在尝试复制错误,但我正在尝试的强制转换操作没有调用 IntfCast。如何让演员调用 IntfCast?
谢谢你。
IntfCast
当您尝试将对象或接口转换为其他接口时调用。这是一些内部调用的示例代码IntfCast
:
type ISomeInterface = interface
[guid-goes-here, use ctr+g to obtain unique guid]
procedure DoSomething;
end;
var X: TComponent;
i: IUnknown;
begin
(X as ISomeInterface).DoSomething;
(i as ISomeInterface).DoSomething;
end;
IntfCast
在动态转换中调用。
阅读此http://hi.baidu.com/007ware/blog/item/de69ed3ce554890abba16726.html