Autor Beitrag
skriiva
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: So 02.05.10 18:50 
Hallo, ich habe ein Probleme zwischen dem Heapstatus meines Projekts und des Systems.
Der Heapstatus soll helfen, die Veränderung bei Listen im Heap zu registrieren.

Meine verwendeter Code:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
uses ShareMem;

type
 THeapStatus = record
    TotalAddrSpace: Cardinal;
    TotalUncommitted: Cardinal;
    TotalCommitted: Cardinal;
    TotalAllocated: Cardinal;
    TotalFree: Cardinal;
    FreeSmall: Cardinal;
    FreeBig: Cardinal;
    Unused: Cardinal;
    Overhead: Cardinal;
    HeapErrorCode: Cardinal;
  end;

var dummy:THeapStatus;


dummy:=ShareMem.GetHeapStatus();


Die Meldung

ausblenden Quelltext
1:
[DCC Fehler] mv.pas(150): E2010 Inkompatible Typen: 'mv.THeapStatus' und 'System.THeapStatus'					

mv ist übrigens der Name meine gespeicherten Form ( Projekt);

lg. skriiva
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19339
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 02.05.10 19:00 
Der Grund ist (der Fehlermeldung nach, habs nicht ausprobiert), dass du THeapStatus noch einmal selbst deklariert hast. GetHeapStatus liefert aber als Resultat den in der Unit System bereits vordefinierten Typ THeapStatus und der ist eben nicht der selbe.

Fazit: Weg mit der eigenen Definition, schon sollte es klappen. ;-)
skriiva Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: So 02.05.10 20:02 
Hat wunderbar geklappt! Danke Schön :P

---Moderiert von user profile iconNarses: Beiträge zusammengefasst---

Welche Einheit ist das eigentlich? Byte oder KB ?
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19339
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 02.05.10 20:09 
Byte, da brauche ich nicht in die Doku zu schauen ;-), aber hier stehts auch nochmal:
docwiki.embarcadero....e/System.THeapStatus
skriiva Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: So 02.05.10 20:11 
Danke! War zu voreilig :D Hatte es gerade durch Ausrechnen rausbekommen