unit uImportCtrl;interface
uses
XMLDoc, XMLIntf, Forms, SysUtils, ActiveX;type
TDllImport = class
private protected public
XMLExamInfoAll: TXMLDocument;
XMLPatInfo : TXMLDocument;
XMLExamInfo : TXMLDocument;
XMLExamDetail : TXMLDocument; constructor Create;
function FreeImportDll: Integer;
end;var
CtrlDll: TDllImport; implementationconstructor TDllImport.Create;
begin
CoInitialize(nil);
XMLExamInfoAll := TXMLDocument.Create(nil);
XMLExamInfoAll.Active := True;
XMLExamInfoAll.Version := '1.0';
XMLExamInfoAll.Encoding:= 'gbk'; XMLPatInfo := TXMLDocument.Create(nil);
XMLPatInfo.Active := True;
XMLPatInfo.Version := '1.0';
XMLPatInfo.Encoding:= 'gbk'; XMLExamInfo := TXMLDocument.Create(nil);
XMLExamInfo.Active := True;
XMLPatInfo.Version := '1.0';
XMLPatInfo.Encoding:= 'gbk'; XMLExamDetail := TXMLDocument.Create(nil);
XMLExamDetail.Active := True;
XMLExamDetail.Version := '1.0';
XMLExamDetail.Encoding:= 'gbk';
end;function TDllImport.FreeImportDll: Integer;
begin
if Assigned(XMLExamInfoAll) then
begin
XMLExamInfoAll.Active := False;
FreeAndNil(XMLExamInfoAll);
end; if Assigned(XMLPatInfo) then
begin
XMLPatInfo.Active := False;
FreeAndNil(XMLPatInfo);
end; if Assigned(XMLExamInfo) then
begin
XMLExamInfo.Active := False;
FreeAndNil(XMLExamInfo);
end; if Assigned(XMLExamDetail) then
begin
XMLExamDetail.Active := False;
FreeAndNil(XMLExamDetail);
end;
end;end.在执行构造函数XMLExamInfoAll := TXMLDocument.Create(nil);是出错,提示地址错误。大家帮忙看看问题出在哪里?
uses
XMLDoc, XMLIntf, Forms, SysUtils, ActiveX;type
TDllImport = class
private protected public
XMLExamInfoAll: TXMLDocument;
XMLPatInfo : TXMLDocument;
XMLExamInfo : TXMLDocument;
XMLExamDetail : TXMLDocument; constructor Create;
function FreeImportDll: Integer;
end;var
CtrlDll: TDllImport; implementationconstructor TDllImport.Create;
begin
CoInitialize(nil);
XMLExamInfoAll := TXMLDocument.Create(nil);
XMLExamInfoAll.Active := True;
XMLExamInfoAll.Version := '1.0';
XMLExamInfoAll.Encoding:= 'gbk'; XMLPatInfo := TXMLDocument.Create(nil);
XMLPatInfo.Active := True;
XMLPatInfo.Version := '1.0';
XMLPatInfo.Encoding:= 'gbk'; XMLExamInfo := TXMLDocument.Create(nil);
XMLExamInfo.Active := True;
XMLPatInfo.Version := '1.0';
XMLPatInfo.Encoding:= 'gbk'; XMLExamDetail := TXMLDocument.Create(nil);
XMLExamDetail.Active := True;
XMLExamDetail.Version := '1.0';
XMLExamDetail.Encoding:= 'gbk';
end;function TDllImport.FreeImportDll: Integer;
begin
if Assigned(XMLExamInfoAll) then
begin
XMLExamInfoAll.Active := False;
FreeAndNil(XMLExamInfoAll);
end; if Assigned(XMLPatInfo) then
begin
XMLPatInfo.Active := False;
FreeAndNil(XMLPatInfo);
end; if Assigned(XMLExamInfo) then
begin
XMLExamInfo.Active := False;
FreeAndNil(XMLExamInfo);
end; if Assigned(XMLExamDetail) then
begin
XMLExamDetail.Active := False;
FreeAndNil(XMLExamDetail);
end;
end;end.在执行构造函数XMLExamInfoAll := TXMLDocument.Create(nil);是出错,提示地址错误。大家帮忙看看问题出在哪里?
把上面的修改为下面的定义试试看XMLExamInfoAll: IXMLDocument;
在我回复你之后 下一个打开的网页 就得到结果啦
http://www.96pc.com/Bc/Delphi/6056.html