Delphi-PRAXiS
Seite 2 von 8     12 34     Letzte »    

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi WLan API Übersetztung ? (https://www.delphipraxis.net/79162-wlan-api-uebersetztung.html)

nitschchedu 19. Okt 2006 10:22

Re: WLan API Übersetztung ?
 
Und wieder habe ich eine Frage !
Habe ich das Richtig Übersetzt ?

Delphi-Quellcode:
#if defined(__midl)
typedef struct {
    unsigned long Data1;
    unsigned short Data2;
    unsigned short Data3;
    byte          Data4[ 8 ];
} GUID;
#else
typedef struct _GUID {
    unsigned long Data1;
    unsigned short Data2;
    unsigned short Data3;
    unsigned char Data4[ 8 ];
} GUID;
Delphi-Quellcode:
TnduGuid = record
    Data1: Longint;
    Data2: Shortint;
    Data3: Shortint;
    Data4: array [0..8] of Byte;
  end;

Klaus01 19. Okt 2006 10:26

Re: WLan API Übersetztung ?
 
Ich würd unsigned short eher mit Byte übersetzen
und unsigned long mit LongWord.

Grüße
Klaus

nitschchedu 19. Okt 2006 10:28

Re: WLan API Übersetztung ?
 
Ok Probiere es mal aus. Danke !

nitschchedu 19. Okt 2006 10:36

Re: WLan API Übersetztung ?
 
Mal noch ne Frage die Arrays im C
Delphi-Quellcode:
 .. [8]
sind doch Felder von 0 - 7
wirde das nicht in Delphi so aussehen

Delphi-Quellcode:
.. [0..7]
??

Klaus01 19. Okt 2006 10:43

Re: WLan API Übersetztung ?
 
ja

ste_ett 19. Okt 2006 11:09

Re: WLan API Übersetztung ?
 
Zitat:

Zitat von nitschchedu
Und wieder habe ich eine Frage !
Habe ich das Richtig Übersetzt ?

Delphi-Quellcode:
#if defined(__midl)
typedef struct {
    unsigned long Data1;
    unsigned short Data2;
    unsigned short Data3;
    byte          Data4[ 8 ];
} GUID;
#else
typedef struct _GUID {
    unsigned long Data1;
    unsigned short Data2;
    unsigned short Data3;
    unsigned char Data4[ 8 ];
} GUID;
Delphi-Quellcode:
TnduGuid = record
    Data1: Longint;
    Data2: Shortint;
    Data3: Shortint;
    Data4: array [0..8] of Byte;
  end;


Zitat:

Zitat von Klaus01
Ich würd unsigned short eher mit Byte übersetzen
und unsigned long mit LongWord.

Grüße
Klaus



GUID ist schon für delphi übersetzt:
Delphi-Quellcode:
PGUID = ^TGUID;
TGUID = packed record
  D1: LongWord;
  D2: Word;
  D3: Word;
  D4: array[0..7] of Byte;
end;
unsigned short ist zwei Byte gross. :)

nitschchedu 19. Okt 2006 13:10

Re: WLan API Übersetztung ?
 
In welcher Unit ? :gruebel: dann kann ich mir das Sparen :o

ste_ett 19. Okt 2006 13:20

Re: WLan API Übersetztung ?
 
Bei D7 Prof in der System.pas.

nitschchedu 19. Okt 2006 13:56

Re: WLan API Übersetztung ?
 
Gut das geht jetzt, und nun habe ich noch das Problem hier
Code:

typedef struct _WLAN_BSS_ENTRY {
    DOT11_SSID dot11Ssid;
    ULONG uPhyId;
    DOT11_MAC_ADDRESS dot11Bssid;
    DOT11_BSS_TYPE dot11BssType;
    DOT11_PHY_TYPE dot11BssPhyType;
    LONG lRssi;
    ULONG uLinkQuality;
    BOOLEAN bInRegDomain;
    USHORT usBeaconPeriod;
    ULONGLONG ullTimestamp;
    ULONGLONG ullHostTimestamp;
    USHORT usCapabilityInformation;
    ULONG ulChCenterFrequency;
    WLAN_RATE_SET wlanRateSet;
    // the beginning of the IE blob
    // the offset is w.r.t. the beginning of the entry
    ULONG ulIeOffset;
    // size of the IE blob
    ULONG ulIeSize;
} WLAN_BSS_ENTRY, * PWLAN_BSS_ENTRY;

// struct WLAN_VARIABLE_SIZE_ARRAY defines a list of entries,
// each of which may have different size
typedef struct _WLAN_BSS_LIST {
    // The total size of the data in BYTE
    DWORD dwTotalSize;
    DWORD dwNumberOfItems;
    WLAN_BSS_ENTRY wlanBssEntries[1];
} WLAN_BSS_LIST, *PWLAN_BSS_LIST;
Delphi-Quellcode:
TnduWLanBSSEntry = record
    dot11Ssid: TnduDot11_SSID;
    uPhyId: ULONG;
    dot11Bssid: TnduDot11_Mac_Address;
    dot11BssType: TnduDot11BssType;
    dot11BssPhyType: TnduDot11PhyType;
    lRssi: Longint;
    uLinkQuality: ULONG;
    bInRegDomain: Boolean;
    usBeaconPeriod: SHORT;
    ullTimestamp: LONGLONG;
    ullHostTimestamp: LONGLONG;
    usCapabilityInformation: SHORT;
    ulChCenterFrequency: ULONG;
    wlanRateSet: TnduWLanRateSet;
    ulIeOffset: ULONG;
    ulIeSize: ULONG;
  end;

  PnduWLanBSSList = ^TnduWLanBSSList;
  TnduWLanBSSList = record
    dwTotalSize: DWORD;
    dwNumberOfItems: DWORD;
    wlanBssEntries: TnduWLanBSSEntry;
  end;
ist das alles richtig übersetzt ?

[edit=Luckie]Wir haben auch Code-Tags für C/C++/C#: [c ], [/c ] Mfg, Luckie[/edit]

nitschchedu 19. Okt 2006 14:28

Re: WLan API Übersetztung ?
 
OK Luckie werde mich dran halten habs eben nicht gefunden aber ist das nun so richtig ?


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:45 Uhr.
Seite 2 von 8     12 34     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-2025 by Thomas Breitkreuz