shellwindow:= CoShellWindows.Create 在Dll的多线程应用中出错! |
缺席
|
linxi
一般會員 ![]() ![]() 發表:17 回覆:15 積分:6 註冊:2004-08-29 發送簡訊給我 |
我目前在做一个NT service 的程序,以下这段代码在Dll中用多线程调用总是出错,各位帮忙看看是什么原因啊?
Procedure Newthread; var IEAddress:string; ShellWindow: IShellwindows; i:integer; web:IWebBrowser2; HTMLDocument: IHTMLDocument2; begin CoInitialize ; shellwindow:= CoShellWindows.Create; //就是这句出错 for i:=0 to shellwindow.Count-1 do begin Web:=shellwindow.Item(i) as IWebbrowser2; IEAddress:=Web.LocationURL; if Application.MessageBox(PChar(IEAddress),Pchar(Caption),MB_YesNo)=IDYes then begin HTMLDocument := Web.Document as IHTMLDocument2; RichEdit1.Lines.Text:=HTMLDocument.body.Get_innerHTML; end; end; CoUninitialize() end; |
Coffee
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:31 回覆:878 積分:561 註冊:2006-11-15 發送簡訊給我 |
|
linxi
一般會員 ![]() ![]() 發表:17 回覆:15 積分:6 註冊:2004-08-29 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |