Board logo

Subject: 实现IOTACodeInsightServices接口的类向IDE注册后应该如果释放?一退出就会出错…… [Print This Page]

Author: Diroc    Time: 2010-4-28 23:32     Subject: 实现IOTACodeInsightServices接口的类向IDE注册后应该如果释放?一退出就会出错……

注册的代码如下所示,
var
  cis: IOTACodeInsightServices;
begin
  if Supports(BorlandIDEServices, IOTACodeInsightServices, cis)
    and (FViewerIndex = cInvalidIndex) then
  begin
    FViewerIndex := cis.AddCodeInsightManager(TQNoteCodeViewer.Create);
  end;
end;

在退出的时候,会执行下面代码
var
  cis: IOTACodeInsightServices;
begin
  if Supports(BorlandIDEServices, IOTACodeInsightServices, cis)
    and (FViewerIndex <> cInvalidIndex) then
  begin
    cis.RemoveCodeInsightManager(FViewerIndex);
    FViewerIndex := cInvalidIndex;
  end;
end;
注册其它接口都不会出错,但是只要注册这个接口后,退出IDE就会弹出读取rtl70.bpl的错误。
各位高人能不能指点一下使用IOTACodeInsightServices的时候,有什么地方需要注意的?是不是实现IOTACodeInsightServices接口的类
编写有什么特殊要求的?




Welcome to CnPack Forum (http://bbs.cnpack.org/) Powered by Discuz! 5.0.0