T
taozhiyu
Unregistered / Unconfirmed
GUEST, unregistred user!
以下GlobeFunction被MainForm和ImageForm调用。在编译的时候出现
错误:"[Error] GlobeFunction.pas(10): Unsatisfied forward or external declaration: 'TReg.WriteRegistry'
[Error] GlobeFunction.pas(11): Unsatisfied forward or external declaration: 'TReg.ReadRegistry'
[Fatal Error] setitem.pas(42): Could not compile used unit 'GlobeFunction.pas'
"
请问这是什么问题啊????
unit GlobeFunction;
interface
uses Registry, Windows;
type
TReg = class
public
function WriteRegistry(Name,Value:string):boolean;
function ReadRegistry(Name:string):String;
end;
implementation
function WriteRegistry(Name,Value:string):boolean;
var
registerTemp : TRegistry;
// HKEY_LOCAL_MACHINE : HKEY;
begin
registerTemp := TRegistry.Create;
with registerTemp do
begin
RootKey := HKEY_LOCAL_MACHINE;
if OpenKey('Software/ASoft',true) then
begin
WriteString(Name,Value);
result := true;
end
else result := false;
CloseKey;
Free;
end;
end;
function ReadRegistry(Name:string):String;
var
RegisterTemp : TRegistry;
begin
RegisterTemp := TRegistry.Create;
RegisterTemp.RootKey := HKEY_LOCAL_MACHINE;
RegisterTemp.OpenKey('Software/ASoft',false);
result := RegisterTemp.ReadString(Name);
//RegisterTemp.CloseKey;
RegisterTemp.Free;
end;
end.
错误:"[Error] GlobeFunction.pas(10): Unsatisfied forward or external declaration: 'TReg.WriteRegistry'
[Error] GlobeFunction.pas(11): Unsatisfied forward or external declaration: 'TReg.ReadRegistry'
[Fatal Error] setitem.pas(42): Could not compile used unit 'GlobeFunction.pas'
"
请问这是什么问题啊????
unit GlobeFunction;
interface
uses Registry, Windows;
type
TReg = class
public
function WriteRegistry(Name,Value:string):boolean;
function ReadRegistry(Name:string):String;
end;
implementation
function WriteRegistry(Name,Value:string):boolean;
var
registerTemp : TRegistry;
// HKEY_LOCAL_MACHINE : HKEY;
begin
registerTemp := TRegistry.Create;
with registerTemp do
begin
RootKey := HKEY_LOCAL_MACHINE;
if OpenKey('Software/ASoft',true) then
begin
WriteString(Name,Value);
result := true;
end
else result := false;
CloseKey;
Free;
end;
end;
function ReadRegistry(Name:string):String;
var
RegisterTemp : TRegistry;
begin
RegisterTemp := TRegistry.Create;
RegisterTemp.RootKey := HKEY_LOCAL_MACHINE;
RegisterTemp.OpenKey('Software/ASoft',false);
result := RegisterTemp.ReadString(Name);
//RegisterTemp.CloseKey;
RegisterTemp.Free;
end;
end.