2020년 5월 9일 토요일

델파이에서 TAcroPDF 사용후 종료시 프로세서가 종료되지 않을 때

델파이에서 TAcroPDF 사용후 종료시 프로세서가 종료되지 않을 때
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
var
  Ref : Integer;
begin
  Ref := AcroPdf1.ControlInterface._AddRef;
  AcroPdf1.Src := '';
  AcroPdf1.Free;
  AcroPdf1 := Nil;
end;
하거나
AcroPDFLib_Tlb.pas 에서 
Type
TAcroPDF = class(TOleControl)
  ...
  public
    destructor Destroy; override; // <- New Line
  ...
  end;

Implementation
.....  
destructor TAcroPDF.Destroy;
begin
 FIntf := NIL;
 inherited;
end;
하면 정상 종료된다.

댓글 없음:

델파이의 부활(Antigravity와의 만남)?

 델파이 프로그램을 사용하여 개인적으로 필요한 프로그램을 생성해 왔는데, 얼마전부터 파이썬으로 옮겨갔다.  그런데 Google 의 Antigravity를 만나고 나서 델파이에 대한 미련을 버리지 못해  제미나이가 Delphi이에 대한 학습도 엄청 했을...