有哪位高人对下列程序做一个解释,我想知道“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.
解决方案 »
- 提取字符串中的数字
- 一个THTTPRIO能不能转换为多个自定义接口?
- 关于sql数据库自动编号的问题?
- 如何在DBGrid中删除选中的记录
- 东信788真正的害了我
- DBGrid 显示的Table的列(Column)的列宽怎么跟DBGrid的宽度一样?
- 我做了个程序,但想让这个程序最大化!(就是要全屏显示,连开始菜单也覆盖掉,也就是真正的全屏),该怎么做??
- GGJJ,有谁知道QQ的界面挂起是怎么实现的!!!不够可以加分
- 痛恨Delphi的15个理由----转载:CoDelphi.com(作者:Softnaf)
- 对不起,我才变态
- 如何在com+组件中应用自定义的类
- 初学者关于图表的问题,100分求助,在线等,解决马上结帖~
function DogCheck: LongInt;external;
{$L mhdelphi.obj}