raised exception class EOleSysError with message '标记没有引用存储' (50分)

  • 主题发起人 主题发起人 wsm
  • 开始时间 开始时间
W

wsm

Unregistered / Unconfirmed
GUEST, unregistred user!
错误'标记没有引用存储'如何解决?
raised exception class EOleSysError with message '标记没有引用存储'
procedure TForm1.TCPServerExecute(AThread: TIdPeerThread);
var
do
MDocument1:TDOMDocument;
SRequest: string;
SOutline: string;
AStream: TStringStream;
Len:Integer;
i:Integer;
begin
with AThread.Connection do
begin
AThread.Synchronize(IncrConnectionCount);
WriteLn('Hello from Indy TCP Stream Server.');
try
UILock.Acquire;
SRequest := UpperCase(ReadLn);
if SRequest = 'OUTLINE' then
begin
AStream := TStringStream.Create(SOutline);
ReadStream(AStream, -1, True);
AStream.Seek(0, soFrombegin
ning);
do
MDocument1:=TDOMDocument.Create(nil);
do
MDocument1.loadXML(AStream.DataString);
[red] Len := do
MDocument1.documentElement.childNodes.Get_length;[/red]
for i := 0 to Len - 1 do
begin
Request.Lines.Add(' '+DOMDocument1.documentElement.childNodes.item.Get_nodeName+':'+DOMDocument1.documentElement.childNodes.item.Text);
end;

do
MDocument1.Free;
AStream.Free;
end;
finally
Disconnect;
UILock.Release;
AThread.Synchronize(DecrConnectionCount);
end;
end;
end;
 
加入对ActiveX单元的引用,然后在主单元文件中:
Initialization
CoInitialize(nil);
Finalization
UnInitialize;
此类COM应用都要调用这两个方法。
 
to grhunter
Initialization
CoInitialize(nil);
Finalization
UnInitialize;
加在 program Project1;中吗?是哪一部分呢?
 
后退
顶部