Thema: Delphi Comparing functions

Einzelnen Beitrag anzeigen

DevidEspenschied

Registriert seit: 7. Sep 2006
Ort: Berlin
439 Beiträge
 
Delphi 12 Athens
 
#75

Re: Comparing functions

  Alt 8. Nov 2007, 12:16
Wow, that was tricky.

Some things to notice. First of all, if you declare a procedure with the name amd64x2, it is better to call it. So the correct FormCreate procedure would be:

Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
begin
  isLoadDr := GetInstance.LoadDriver;
  if not isLoadDr then MessageBox(form1.Handle,'Couldn''t Start I/O Driver! Some features will be disabled!', 'Couldn''t Start I/O Driver!', MB_ICONINFORMATION)
  else amd64x2;
end;
The next thing is within amd64x2, where you have the following if line:

cxCpu401.Available.Available=2 According to the TcxCPU40 component this line checks, if there is more then one physical core. But that is not correct, because my AMD Athlon 64 +3400 does have only one core (here the value 1) and that core provides internal temperature readings via #THERMPRIP. So the line should be updated to:

cxCpu401.Available.Available IN [1..2] And the last, but most catastrophically thing, is the exception, which is generated with the line:

GetInstance.IPCIIORef.GetPCIRDWord(0,24,$03,$E4,pdata); within TForm1.Timer1Timer. And I doesn't have the time to check this within the OMCDrv unit, because there are so many types, classes and structurtes. I would suggest, you manipulate this program somehow to read a basic PC port, such as the parallel port ($378) or the CMOS port ($70) to make sure, that your core reading routine works fine. The results from these port readings could be shown via the ShowMessage function, and compared with a simple DOS reading. Herefore you could create a simple DOS application like:

Delphi-Quellcode:
program dosporttest;
uses crt, dos;
begin
  clrscr;
  writeln(port[$378]);
  writeln(port[$70]);
  readln;
end.
At least that is always my way to verify a windows based hardware near function.
Devid
  Mit Zitat antworten Zitat