implementation
uses Watherunt,Mainunt;
{ TWatchThread }
constructor TWatchThread.Create(MRenW:string;Path: string;
FNotifyFilter: Dword;
Dir: boolean;Topath:string);
begin
RenW:=MRenw;
MonitorPath:=path;
FNotify:=FNotifyFilter;
MonitorDir:=Dir;
ToServerPath:=Topath;
FreeOnTerminate :=true;
inherited Create(true);
end;
procedure TWatchThread.Execute;
begin
Mainfrm.Monitor2.RemoteMachineName:=PServerIp;//Monitor2是注册组件 只再这里用
while not Terminateddo
begin
//EnterCriticalSection(CS);//进入临界区
Watch(RenW,MonitorPath,FNotify,MonitorDir,ToServerPath);
//调用监视函数
//LeaveCriticalSection(CS);//退出临界区
end;
end;
initialization
Coinitialize(nil);
finalization
CoUninitialize;
end.
创建一个线程的时候提示 ‘尚没有Coinitialize‘
怎么办?
错误!