用CreateOleObject创建的对象是否需要显式地释放?怎样释放?

xiaoboey 2003-03-19 11:30:44
用CreateOleObject创建的对象是否需要显式地释放?怎样释放?
...全文
219 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
qxj 2003-03-19
  • 打赏
  • 举报
回复
楼上的老兄:myexcel.visible :=false;我的好象不行,不定要true。
naughtyboy 2003-03-19
  • 打赏
  • 举报
回复
procedure tbutton1clicek(sendor.tobject);
var
myexcel:variant;
begin
myexcel:=createoleobject('excel.application');
myexcel.visible:=false;
...
//释放时用以下语句
myexcel:=unassigned;
end;
xiaoboey 2003-03-19
  • 打赏
  • 举报
回复
谢谢各位!“you can release the interface by assigning the Unassigned constant to that Variant”--Delphi在线帮助本来是有说明的,我没注意到。
Linux2001 2003-03-19
  • 打赏
  • 举报
回复
直接给myexcel :=nil就可以了

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧