Autor Beitrag
Tana´Ri
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 230



BeitragVerfasst: Di 27.07.04 15:14 
Hi Leute,

wollte gerade mal UDP - Infos anzeigen, leider ist der Array bzw. der Pointer immer NIL, obwohl die Funktion = NO_ERROR zurückliefert und Getlasterror = 0 ist.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
   
   GetUdpTable(nil,size,true); // benötigter Speicher ermitteln
   GetMem(table,size);
   try
    if GetUdpTable(table,size,true) = NO_Error then
     for i:=0 to MIB_UDPTABLE(table^).EntriesCount-1 do // EntriesCount stimmt auch ( vergl. GetUdpStatistics() )
      if MIB_UDPTABLE(table^).Entries <> NIL then begin // ist TRUE (sollte eigentlich mit TableEntries gefüllt sein)
         IpAddr := MIB_UDPTABLE(table^).Entries[i].lIpAddr;
         with mem.Lines do Add(inet_ntoa(in_addr(IpAddr)));
      end;
   finally
    FreeMem(table);
   end;

_________________
mfg
Tana´Ri
Tana´Ri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 230



BeitragVerfasst: Mi 28.07.04 12:40 
habs 8)

dynamisch bzw. MinimalPrinzip funktionierten ja nicht,
hab jetzt im Record beim Pointer auf ein Array [AnySize] of Struktur
einfach ne feste (0..1024) Größe gesetzt und damit gehts.

_________________
mfg
Tana´Ri