//连接FTP的
procedure TFtpThread.Execute;
begin
FreeOnTerminate := True;
if not FtpConnState then
begin
FtpConnState := ConnFtp(MainForm.FtpLibrary,UserName,PassWord);
SendMessage(MainForm.Handle,WM_CONNFTP,Integer(PChar(FtpConnState)),0);
end;
end;
//上传文件的
procedure TUpLoadThread.Execute;
begin
FreeOnTerminate := True;
if not FtpConnState then
begin
MainForm.FtpLibrary.RemotePath :='446\1.txt';
MainForm.FtpLibrary.LocalPath:='c:\1.txt';
MainForm.FtpLibrary.Upload;
end;
end;上面的FtpLibrary是一个主窗体上的OCX控件 如果在主线程中直接调用没问题 放在线程里就不行了就会报access violation at address in module 'MSVBVM60.DLL'错误
procedure TFtpThread.Execute;
begin
FreeOnTerminate := True;
if not FtpConnState then
begin
FtpConnState := ConnFtp(MainForm.FtpLibrary,UserName,PassWord);
SendMessage(MainForm.Handle,WM_CONNFTP,Integer(PChar(FtpConnState)),0);
end;
end;
//上传文件的
procedure TUpLoadThread.Execute;
begin
FreeOnTerminate := True;
if not FtpConnState then
begin
MainForm.FtpLibrary.RemotePath :='446\1.txt';
MainForm.FtpLibrary.LocalPath:='c:\1.txt';
MainForm.FtpLibrary.Upload;
end;
end;上面的FtpLibrary是一个主窗体上的OCX控件 如果在主线程中直接调用没问题 放在线程里就不行了就会报access violation at address in module 'MSVBVM60.DLL'错误
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货