L
let_it_be
Unregistered / Unconfirmed
GUEST, unregistred user!
在网上下载了一个Auto Complete 的例子,改了下,不知道这样才能去掉 AutoComplete 的功能(下面红色字体),是不是将 接口 释放,但是怎样释放都不行哦。
procedure TAutoCompleteForm.Button1Click(Sender: TObject);
begin
Fstrings:=nil;
FautoComplete:=nil;
FAutoComplete := CreateComObject(CLSID_AutoComplete) as IAutoComplete2;
FStrings := TEnumString.Create(SourceMemo.Lines) as IUnknown;
OleCheck(FAutoComplete.SetOptions(ACO_AUTOSUGGEST or ACO_UPDOWNKEYDROPSLIST));
OleCheck(FAutoComplete.Init(CompletionEdit.Handle, FStrings, nil, nil));
end;
procedure TAutoCompleteForm.Button2Click(Sender: TObject);
begin
FStrings:=nil;
FautoComplete:=nil;
FAutoComplete := CreateComObject(CLSID_AutoComplete) as IAutoComplete2;
FStrings := TEnumString.Create(memo1.Lines) as IUnknown;
OleCheck(FAutoComplete.SetOptions(ACO_AUTOSUGGEST or ACO_UPDOWNKEYDROPSLIST));
OleCheck(FAutoComplete.Init(CompletionEdit.Handle, FStrings, nil, nil));
end;
procedure TAutoCompleteForm.Button3Click(Sender: TObject);
begin
[red]FAutoComplete:=nil; // 这样为什么没有效果?[/red]
end;
end.
procedure TAutoCompleteForm.Button1Click(Sender: TObject);
begin
Fstrings:=nil;
FautoComplete:=nil;
FAutoComplete := CreateComObject(CLSID_AutoComplete) as IAutoComplete2;
FStrings := TEnumString.Create(SourceMemo.Lines) as IUnknown;
OleCheck(FAutoComplete.SetOptions(ACO_AUTOSUGGEST or ACO_UPDOWNKEYDROPSLIST));
OleCheck(FAutoComplete.Init(CompletionEdit.Handle, FStrings, nil, nil));
end;
procedure TAutoCompleteForm.Button2Click(Sender: TObject);
begin
FStrings:=nil;
FautoComplete:=nil;
FAutoComplete := CreateComObject(CLSID_AutoComplete) as IAutoComplete2;
FStrings := TEnumString.Create(memo1.Lines) as IUnknown;
OleCheck(FAutoComplete.SetOptions(ACO_AUTOSUGGEST or ACO_UPDOWNKEYDROPSLIST));
OleCheck(FAutoComplete.Init(CompletionEdit.Handle, FStrings, nil, nil));
end;
procedure TAutoCompleteForm.Button3Click(Sender: TObject);
begin
[red]FAutoComplete:=nil; // 这样为什么没有效果?[/red]
end;
end.