![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Процесс не может получить доступ к файлу [D7, WinXP]
Мастак © (2008-04-19 10:12:00)"выжимка" - для отлова ошибки
в xml_out.SaveToFile(file_out); (в TMSDOMDocument.save, urlmon.dll (Windows XP Prof SP2))
... raised exception class EOLEException with message 'Процесс не может получить доступ к файлу,
так как этот файл занят другим процессом'
?????????
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons,
XMLDoc, XMLIntf;
type
TForm1 = class(TForm)
BitBtn1: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
var
Node_zapis_out: IXMLNode;
xml_out: TXMLDocument;
file_out: string;
begin
file_out:='send.xml';
FileCreate(file_out);
FileSetAttr(file_out, faArchive);
xml_out := TXMLDocument.Create(Self);
xml_out.Active := true;
xml_out.Version := '1.0';
xml_out.Encoding := 'UTF-8';
xml_out.StandAlone := 'no';
xml_out.AddChild('PATIENTS');
Node_zapis_out:=xml_out.DocumentElement.AddChild('PATIENT');
Node_zapis_out.AddChild('ID').Text:=
'8a87a88115f0b0d70115f0e86c1b0004';
Node_zapis_out.AddChild('FAMILY').Text:=
'Абрамович';
xml_out.SaveToFile(file_out);
end;
end.
И каким еще другим процессом может быть занят?
Иначе попробовать с файлами?
Мастак (2008-04-19 14:18:00) [1]Вопрос снят.
процедура xml_out.SaveToFile(file_out) создает сама указ. файл