I
it2188
Unregistered / Unconfirmed
GUEST, unregistred user!
写成的dll中带有调用了TNMUUProcessor控件,编译通过,调用该dll时,出错?
如何修改?这个dll的用途是输入一个base64编码的文件名,生成解码的文件。
出现警告:[Warning] Unit1.pas(34): Variable 'base64' might not have been initialized
源代码:
unit Unit1;
{$WARN SYMBOL_PLATFORM OFF}
interface
uses
ComObj, ActiveX, AspTlb, maildebase64_TLB, StdVcl,Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Dialogs, StdCtrls,NMUUE;
type
Tdebase64 = class(TASPMTSObject, Idebase64)
private
infile:string;
protected
procedure debase; safecall;
procedure Set_emlname(const Value: WideString); safecall;
end;
implementation
uses ComServ,Unit2;
procedure Tdebase64.debase;
var
outfile:string;
InStream,OutStream: TFileStream;
base64:TNMUUProcessor;
begin
outfile:=infile+'txt';
InStream := TFileStream.Create(infile, fmOpenRead);
OutStream := TFileStream.Create(outfile, fmCreate);
try
base64.Create(nil);
base64.Method:=uuMIME;
base64.InputStream:=InStream;
base64.OutputStream:=OutStream;
base64.Decode;
finally
InStream.Free;
OutStream.Free;
base64.Free;
end;
end;
procedure Tdebase64.Set_emlname(const Value: WideString);
begin
infile:=vartostr(Value);
end;
initialization
TAutoObjectFactory.Create(ComServer, Tdebase64, Class_debase64,
ciMultiInstance, tmApartment);
end.
如何修改?这个dll的用途是输入一个base64编码的文件名,生成解码的文件。
出现警告:[Warning] Unit1.pas(34): Variable 'base64' might not have been initialized
源代码:
unit Unit1;
{$WARN SYMBOL_PLATFORM OFF}
interface
uses
ComObj, ActiveX, AspTlb, maildebase64_TLB, StdVcl,Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Dialogs, StdCtrls,NMUUE;
type
Tdebase64 = class(TASPMTSObject, Idebase64)
private
infile:string;
protected
procedure debase; safecall;
procedure Set_emlname(const Value: WideString); safecall;
end;
implementation
uses ComServ,Unit2;
procedure Tdebase64.debase;
var
outfile:string;
InStream,OutStream: TFileStream;
base64:TNMUUProcessor;
begin
outfile:=infile+'txt';
InStream := TFileStream.Create(infile, fmOpenRead);
OutStream := TFileStream.Create(outfile, fmCreate);
try
base64.Create(nil);
base64.Method:=uuMIME;
base64.InputStream:=InStream;
base64.OutputStream:=OutStream;
base64.Decode;
finally
InStream.Free;
OutStream.Free;
base64.Free;
end;
end;
procedure Tdebase64.Set_emlname(const Value: WideString);
begin
infile:=vartostr(Value);
end;
initialization
TAutoObjectFactory.Create(ComServer, Tdebase64, Class_debase64,
ciMultiInstance, tmApartment);
end.