有哪位高人对下列程序做一个解释,我想知道“function DogCheck: longint; external;” 这个外部函数是怎么调用的,它在哪儿?万分感谢!!!!program Trainer;uses
Windows,
...........{ The type of these six functions are longint }
function DogCheck: longint; external;
function DogConvert: longint; external;
function WriteDog: longint; external;
function ReadDog: longint; external;
function DisableShare: longint; external;
function GetCurrentNo: longint; external;
function SetPassword: longint; external;
function SetDogCascade: longint; external;
{$L mhdelphi.obj}{$R *.RES}
var
DogCascade: integer;
........
begin
Application.Initialize;
DogCascade := 0;
dwRetCode := DogCheck();
if (dwRetCode<>0) then {0 means susccess}
begin
szMessage := '请检查硬件狗是否存在,程序将退出!'+#13;
Application.MessageBox(PChar(szMessage),'错误提示',0);
EndRealtimeDatabase();
Application.Terminate;
exit;
end;
ConvertData:= '83499818';
DogCascade:= 0;
DogBytes:= 8;
DogData:= @ConvertData[1];
dwRetCode:= DogConvert();
if dwRetCode<>0 then
begin
szMessage := '校验硬件狗失败,程序将退出!'+#13;
//szMessage := szMessage + 'Error code is '+IntToStr(dwRetCode);
//MessageBox(Handle, PChar(szMessage), PChar('错误提示'), 16);
Application.MessageBox(PChar(szMessage),'错误提示',0);
EndRealtimeDatabase();
Application.Terminate;
exit;
end
else
begin
if DogResult<>3402884680 then
begin
szMessage := '硬件狗校验值不匹配,程序将退出!'+#13;
//szMessage := szMessage + 'Error code is '+IntToStr(dwRetCode);
//MessageBox(Handle, PChar(szMessage), PChar('错误提示'), 16);
Application.MessageBox(PChar(szMessage),'错误提示',0);
EndRealtimeDatabase();
Application.Terminate;
exit;
end;
end; FormSplash:=TFormSplash.Create(Application);
FormSplash.Show;
FormSplash.Update; while FormSplash.Timer1.Enabled do
Application.ProcessMessages; F_SelMod:=TF_SelMod.Create(Application);
F_SelMod.Show;
F_SelMod.Update;
FormSplash.Hide;
FormSplash.Free; while F_SelMod.Timer1.Enabled do
Application.ProcessMessages; if SelModOkFlag then
begin
Application.CreateForm(TF_Trainer, F_Trainer);
Application.CreateForm(TF_DllFun, F_DllFun);
Application.CreateForm(TF_AlgList, F_AlgList);
Application.CreateForm(TF_ShowOperation, F_ShowOperation);
Application.CreateForm(TF_AddFault, F_AddFault);
Application.CreateForm(TF_EFormList, F_EFormList);
Application.CreateForm(TF_DelFault, F_DelFault);
Application.CreateForm(TF_RunDpuWait, F_RunDpuWait);
end
else
begin
EndRealtimeDatabase();
Application.Terminate;
end; Application.Run;end.
Windows,
...........{ The type of these six functions are longint }
function DogCheck: longint; external;
function DogConvert: longint; external;
function WriteDog: longint; external;
function ReadDog: longint; external;
function DisableShare: longint; external;
function GetCurrentNo: longint; external;
function SetPassword: longint; external;
function SetDogCascade: longint; external;
{$L mhdelphi.obj}{$R *.RES}
var
DogCascade: integer;
........
begin
Application.Initialize;
DogCascade := 0;
dwRetCode := DogCheck();
if (dwRetCode<>0) then {0 means susccess}
begin
szMessage := '请检查硬件狗是否存在,程序将退出!'+#13;
Application.MessageBox(PChar(szMessage),'错误提示',0);
EndRealtimeDatabase();
Application.Terminate;
exit;
end;
ConvertData:= '83499818';
DogCascade:= 0;
DogBytes:= 8;
DogData:= @ConvertData[1];
dwRetCode:= DogConvert();
if dwRetCode<>0 then
begin
szMessage := '校验硬件狗失败,程序将退出!'+#13;
//szMessage := szMessage + 'Error code is '+IntToStr(dwRetCode);
//MessageBox(Handle, PChar(szMessage), PChar('错误提示'), 16);
Application.MessageBox(PChar(szMessage),'错误提示',0);
EndRealtimeDatabase();
Application.Terminate;
exit;
end
else
begin
if DogResult<>3402884680 then
begin
szMessage := '硬件狗校验值不匹配,程序将退出!'+#13;
//szMessage := szMessage + 'Error code is '+IntToStr(dwRetCode);
//MessageBox(Handle, PChar(szMessage), PChar('错误提示'), 16);
Application.MessageBox(PChar(szMessage),'错误提示',0);
EndRealtimeDatabase();
Application.Terminate;
exit;
end;
end; FormSplash:=TFormSplash.Create(Application);
FormSplash.Show;
FormSplash.Update; while FormSplash.Timer1.Enabled do
Application.ProcessMessages; F_SelMod:=TF_SelMod.Create(Application);
F_SelMod.Show;
F_SelMod.Update;
FormSplash.Hide;
FormSplash.Free; while F_SelMod.Timer1.Enabled do
Application.ProcessMessages; if SelModOkFlag then
begin
Application.CreateForm(TF_Trainer, F_Trainer);
Application.CreateForm(TF_DllFun, F_DllFun);
Application.CreateForm(TF_AlgList, F_AlgList);
Application.CreateForm(TF_ShowOperation, F_ShowOperation);
Application.CreateForm(TF_AddFault, F_AddFault);
Application.CreateForm(TF_EFormList, F_EFormList);
Application.CreateForm(TF_DelFault, F_DelFault);
Application.CreateForm(TF_RunDpuWait, F_RunDpuWait);
end
else
begin
EndRealtimeDatabase();
Application.Terminate;
end; Application.Run;end.
解决方案 »
- 怎么才能直接播放加密的音频或视频文件呢?
- delphi 处学者问几个难题
- Windows NT Service能否有窗口??
- 急问高手一组件问题?
- 请问Delphi中什么时间函数的计时能达到微秒级,如果没有毫秒级的也行
- 我想做一个拖动程序(拖动label),不知怎么做?格哦说说!有本事来拿吧
- Insufficient memory for this operation.alias:**
- 求DBGrid(DBGRidEH)表头背景用渐变色的方法?
- 学术讨论!进者有分
- ADO怎么连带密码的ACCESS2000
- 如何在com+组件中应用自定义的类
- 初学者关于图表的问题,100分求助,在线等,解决马上结帖~
function DogCheck: LongInt;external;
{$L mhdelphi.obj}