Delphi-PRAXiS
Seite 6 von 9   « Erste     456 78     Letzte »    

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Comparing functions (https://www.delphipraxis.net/98537-comparing-functions.html)

DevidEspenschied 5. Nov 2007 09:10

Re: Comparing functions
 
Zitat:

Zitat von Razor
As you can see here i was experimenting something and the below looked like is it gonna happen but should i worry about warning?

Delphi-Quellcode:
procedure tmainfrm.amd64x2start;
var
C0:string;
GetInstance:tomcdrv;
pdata: DWord;
begin

       GetInstance.IPCIIORef.GetPCIRDWord(0,24,$03,$E4,pdata);
       GetInstance.IPCIIORef.SetPCIRDWord(0,24,$03,$E4, pdata and not (1 shl 2));
       GetInstance.IPCIIORef.GetPCIRDWord(0,24,$03,$E4,pdata);
       C0:=Format('%d °C',[(pdata shr 16 and $FF)-49]);
       RzLabel99.caption:=C0;

//But then i get [Warning] Temperatures.inc(117): Variable 'GetInstance' might not have been initialized

Thats because TOMCDrv is a class with an initialization routine, which has to be run first. Begin this procedure with GetInstance.Create()

Zitat:

Zitat von Razor
Delphi-Quellcode:
procedure tmainfrm.amd64x2start;
var
C0:string;

pdata: DWord;
begin

       OMCDRV.tGetPCIRDWord(0,24,$03,$E4,pdata);
       OMCDRV.tSetPCIRDWord(0,24,$03,$E4, pdata and not (1 shl 2));
       OMCDRV.tGetPCIRDWord(0,24,$03,$E4,pdata);
       C0:=Format('%d °C',[(pdata shr 16 and $FF)-49]);
       RzLabel99.caption:=C0;

//But then i get [Fatal Error]Internal error: BA1993 or [Fatal Error] Internal error: L1333

I've never had that kind of error and the documentation doesn't provide any info.

But why don't you create a large class and add there all functions for port reading, msr reading and so on ? Your unit contains a lot of double functions, e.g. 4 or 5 times the readportbyte function. That could be combined into one class to avoid those kind of error messages.

Razor 5. Nov 2007 09:11

Re: Comparing functions
 
Okay i will post the thing i am working on as we speak.. :)

Razor 5. Nov 2007 09:20

Re: Comparing functions
 
Okay done i get result -49 C but i dont have AMD so yea...

DevidEspenschied 5. Nov 2007 09:23

Re: Comparing functions
 
Let me test this project on my Athlon64 and I will get back to you later today.

Razor 5. Nov 2007 09:49

Re: Comparing functions
 
Okay the new version with the omc driver so yea go ahead and test it.If you find a bug report back... :zwinker:

[edit=Phoenix]Anhang wg. Copyright entfernt. Mfg, Phoenix[/edit]

Muetze1 5. Nov 2007 13:56

Re: Comparing functions
 
Zitat:

Zitat von devidespe
Had the same problem here too and Delphi needs sometimes a complete code compilation (sometimes 2 or 3 times) to know, that a variable is a DWord and not a Cardinal. But that must have mean, that a cardinal type was there previously.

It is a complete normal behaviour, known - at least - since D3. Delphi extends all size-specific to the actual (compiler size) generic types. So LongInt will be shown as Integer, LongWord as Cardinal, etc. The data types are equal for the actual compiler (32 Bit Compiler), so don't care.

Razor 5. Nov 2007 19:05

Re: Comparing functions
 
Did anybody test this :shock:

mkinzler 5. Nov 2007 19:24

Re: Comparing functions
 
It doesn't work on Vista 64Bit

Razor 5. Nov 2007 19:27

Re: Comparing functions
 
Hmm driver is 64 bit compliant can you try to look in the code? :?

mkinzler 5. Nov 2007 19:34

Re: Comparing functions
 
I ain't a problem of lack of 64bit capability. The programm isn't able to load the IO-driver.


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:46 Uhr.
Seite 6 von 9   « Erste     456 78     Letzte »    

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz