CnPack Forum


 
jAmEs_
灌水部部长
Rank: 8Rank: 8



Medal No.1  
UID 886
Digest Posts 0
Credits 1134
Posts 600
点点分 1134
Reading Access 10
Registered 2005-6-5
Location 广东
Status Offline
Post at 2009-7-13 13:28  Profile | Blog | P.M. 
[Help]OTA

用RegisterDesignNotification 註冊一個Designer的監控器,退出總是會造成異常,不知道要怎麼處理才不會這樣?
http://www.delphigroups.info/2/7/797982.html 這裡有個案例,但是不太明白他們說的解決方法。
Top
jAmEs_
灌水部部长
Rank: 8Rank: 8



Medal No.1  
UID 886
Digest Posts 0
Credits 1134
Posts 600
点点分 1134
Reading Access 10
Registered 2005-6-5
Location 广东
Status Offline
Post at 2009-7-13 13:29  Profile | Blog | P.M. 
http://bbs.cnpack.org/viewthread.php?action=printable&tid=154
這裡提到這個,但是沒有具體例子。
Top
jAmEs_
灌水部部长
Rank: 8Rank: 8



Medal No.1  
UID 886
Digest Posts 0
Credits 1134
Posts 600
点点分 1134
Reading Access 10
Registered 2005-6-5
Location 广东
Status Offline
Post at 2009-7-13 23:22  Profile | Blog | P.M. 
好像这样可以解决:
通过变量保存IDesignNotification接口指针,然后结束时,把指针赋值nil。

var
MyNotify:IDesignNotification;

initialization
try
MyNotify:=TMyNotify.Create;
except
MyNotify:=nil;
Raise;
end;
RegisterDesignNotification(MyNotify);

finalization
UnRegisterDesignNotification(MyNotify);
MyNotify:=nil;

end.
Top
 




All times are GMT++8, the time now is 2024-11-23 05:46

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.009178 second(s), 8 queries , Gzip enabled

Clear Cookies - Contact Us - CnPack Website - Archiver - WAP