What is the problem of TWEBBROWSER in use (BUG?)

zhaozj2021-02-16  89

First explain, my environment is Windows 2000 Datacenter Server (playing), Delphi 7ie6 SP1 I have appeared in the use of TWEBBROWSER, I don't really release all resources after I don't really release anything I think there should be 1-twebbrowser.free. ... In fact, this phenomenon only occurs when using TWebBBrowser.Document, I can observe a detail: when calling TWEBBROWSER.Document, the reference counter is not 1, but 3! However, when canceling the reference, it is still released according to 1, which leads to the phenomenon of unleteration of the reference counter ... I can't understand the problem of IE kernel or the problem of delphi packaging (not brain power), in 98 IE5 XP IE6SP1 2000 IE6SP1 and other environments Test the same program has this situation, the processing method seems to manually call two release interface reference 2-Document.parentWindow: IHTMLWindow2 This interface does not have obvious problems when the counter does not have a significant problem, if using _ If addRef, the return result is always 0, but it actually counts normal ... Document: IHTMLDocument2 in 98, it seems to be the problem of IE itself? ... 3-TWEBBROWSER.SETFOCUS method does not allow the browser control to get focus, and the form is closed (should be triggered at the same time) (the level is limited, I don't understand how this exception). At this time, the approach is to find the real browser control handle with FindWindowEx, then use the SendMessage to simulate click (I guess this method is definite enough, who has a better way, please tell me), this is definitely Delphi package something wrong

转载请注明原文地址:https://www.9cbs.com/read-13476.html

New Post(0)