IntfCast in Delphi 6
I have a project where a large amount of the source code is unavailable. There's an IntfCast exception in one of the functions and I've beens stepping through the application with the CPU debugger and have identified the function containing the casting operation and one of the classes involved, but I can't identify the other class. I am trying to replicate the error but the casting operation I开发者_JS百科'm attempting is not calling IntfCast. How do I get the cast to call IntfCast?
Thank you.
IntfCast
is called when you try to cast an object or an interface to an other interface. Here's some sample code that internally calls 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
is called in dynamic casting.
Read this http://hi.baidu.com/007ware/blog/item/de69ed3ce554890abba16726.html
精彩评论