var
ShellWindow : IShellWindows;
nCount : Integer;
begin
while not terminated do begin
try
ShellWindow := CoShellWindows.Create;
nCount := ShellWindow.Count;
except
end;
sleep(1000);
end;
在Thread错误信息:标记没有引用存储如果写在不写在Thread中,程序运行正常?不知道为什么了?
ShellWindow : IShellWindows;
nCount : Integer;
begin
while not terminated do begin
try
ShellWindow := CoShellWindows.Create;
nCount := ShellWindow.Count;
except
end;
sleep(1000);
end;
在Thread错误信息:标记没有引用存储如果写在不写在Thread中,程序运行正常?不知道为什么了?
uses ActiveX;var
ShellWindow : IShellWindows;
nCount : Integer;
begin
CoInitialize(nil);
try
while not terminated do begin
try
ShellWindow := CoShellWindows.Create;
nCount := ShellWindow.Count;
except
end;
sleep(1000);
finally
CoUnInitialize;
end;
end;
var
ShellWindow : IShellWindows;
nCount : Integer;
begin
CoInitialize(nil);
try
while not terminated do begin
try
ShellWindow := CoShellWindows.Create;
nCount := ShellWindow.Count;
except
end;
sleep(1000);
finally
CoUninitialize
end;
end;