Delphi-PRAXiS
Seite 1 von 2  1 2      

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 17. Okt 2006 13:55


WLan API Übersetztung ?
 
Wie Übersetzte ich den das ins Delphi ? Will nehmlich eine Unit schreiben.

:roll:

Delphi-Quellcode:
#define WLAN_API_VERSION_MAJOR(_v) ((_v) & 0xffff)
#define WLAN_API_VERSION_MINOR(_v) (((DWORD)(_v)) >> 16)
#define WLAN_API_MAKE_VERSION(_major, _minor)  (((DWORD)(_minor)) << 16 | (_major))

chaosben 17. Okt 2006 14:13

Re: WLan API Übersetztung ?
 
Ich vermute mal, so:

Delphi-Quellcode:
function WLAN_API_VERSION_MAJOR(AVersion : LongWord) : Word;
begin
  Result:=AVersion and $FFFF;
end;

function WLAN_API_VERSION_MINOR(AVersion : LongWord) : Word;
begin
  Result:=AVersion shr 16;
end;

function WLAN_API_MAKE_VERSION(AMajor, AMinor : Word) : LongWord;
begin
  Result:=(LongWord(AMinor) shl 16) or AMajor;
end;

nitschchedu 17. Okt 2006 14:17

Re: WLan API Übersetztung ?
 
könnte klaben danke :-D

nitschchedu 18. Okt 2006 07:20

Re: WLan API Übersetztung ?
 
Habe da mal noch ne Frage , Habe ich das richtig übersetzt ?

Delphi-Quellcode:
 function WlanOpenHandle(dwClientVersion: DWORD;
    pReserved: PBOOL; pdwNegotiatedVersion: DWORD;
    phClientHandle: PHandle): DWORD; stdcall; external 'wlanapi.dll';
|
|
|
v
Delphi-Quellcode:

// public APIs
DWORD WINAPI
WlanOpenHandle(
    __in DWORD dwClientVersion,
    __reserved PVOID pReserved,
    __out PDWORD pdwNegotiatedVersion,
    __out PHANDLE phClientHandle
);

Und das habe ich mal so übersetzt ich hoffe das stimmt.

Delphi-Quellcode:
TnduWLanInterFaceState = (wlan_interface_state_not_ready = 0,
    wlan_interface_state_connected,
    wlan_interface_state_ad_hoc_network_formed,
    wlan_interface_state_disconnecting,
    wlan_interface_state_disconnected,
    wlan_interface_state_associating,
    wlan_interface_state_discovering,
    wlan_interface_state_authenticating);
|
|
|
v
Delphi-Quellcode:

// the states of the network (interface)
#ifdef __midl
// use the 4-byte enum
typedef [v1_enum] enum _WLAN_INTERFACE_STATE {
#else
typedef enum _WLAN_INTERFACE_STATE {
#endif
    wlan_interface_state_not_ready = 0,
    wlan_interface_state_connected,
    wlan_interface_state_ad_hoc_network_formed,
    wlan_interface_state_disconnecting,
    wlan_interface_state_disconnected,
    wlan_interface_state_associating,
    wlan_interface_state_discovering,
    wlan_interface_state_authenticating
} WLAN_INTERFACE_STATE, *PWLAN_INTERFACE_STATE;
???????

ste_ett 18. Okt 2006 07:45

Re: WLan API Übersetztung ?
 
Zitat:

Zitat von nitschchedu
Habe da mal noch ne Frage , Habe ich das richtig übersetzt ?

Delphi-Quellcode:
 function WlanOpenHandle(dwClientVersion: DWORD;
    pReserved: PBOOL; pdwNegotiatedVersion: DWORD;
    phClientHandle: PHandle): DWORD; stdcall; external 'wlanapi.dll';
|
|
|
v
Delphi-Quellcode:

// public APIs
DWORD WINAPI
WlanOpenHandle(
    __in DWORD dwClientVersion,
    __reserved PVOID pReserved,
    __out PDWORD pdwNegotiatedVersion,
    __out PHANDLE phClientHandle
);


PVOID ist ein einfacher Pointer.
PDWORD kannst du so übernehmen.

chaosben 18. Okt 2006 07:51

Re: WLan API Übersetztung ?
 
Was "__reserved" bedeutet weiß ich leider nicht.
Aber "__out" sieht nach einem Out-Parameter aus. Das entsprechende Schlüsselwort gibts auch in Delphi.

Luckie 18. Okt 2006 08:16

Re: WLan API Übersetztung ?
 
PDWORD würde ich als var Parameter übersetzen.

nitschchedu 18. Okt 2006 08:26

Re: WLan API Übersetztung ?
 
Danke Leute es geht jetzt !!! :thumb: Juhhuu :spin2:

nitschchedu 18. Okt 2006 11:01

Re: WLan API Übersetztung ?
 
Ich muss euch norchmal Nerven !
Wie Muss ich den das übersetzten?
Code:
typedef struct _WLAN_INTERFACE_INFO_LIST {
    DWORD dwNumberOfItems;
    DWORD dwIndex;

#ifdef __midl
    [unique, size_is(dwNumberOfItems)] WLAN_INTERFACE_INFO InterfaceInfo[*];
#else
    WLAN_INTERFACE_INFO InterfaceInfo[1];
#endif
weil ich habe das hier gefunden .

Code:

1.   #include <windows.h>
2.   #include <Wlanapi.h>
3.   #pragma comment(lib,"Wlanapi.lib")
4.   int _tmain(int argc, _TCHAR* argv[])
5.   {
6.           HANDLE hClient;
7.           DWORD dwVersion;
8.           WLAN_INTERFACE_INFO_LIST *pInterfaces = NULL;    
9.           WLAN_BSS_LIST *bssList;
10.           switch (WlanOpenHandle(1,NULL, &dwVersion, &hClient))
11.           {
12.           case ERROR_SUCCESS:                  
13.                   if(WlanEnumInterfaces(hClient, NULL,&pInterfaces)==ERROR_SUCCESS)
14.                   {
15.                           for(DWORD i=0;i<pInterfaces->dwNumberOfItems;i++)
16.                           {
17.                                   wprintf(L"Interface -- %s\n", pInterfaces[i].InterfaceInfo->strInterfaceDescription );      
18.                                   if(WlanGetNetworkBssList(hClient,&pInterfaces[i].InterfaceInfo->InterfaceGuid ,NULL,dot11_BSS_type_any,FALSE,NULL,&bssList)==ERROR_SUCCESS)
19.                                   {
20.                                           for(DWORD j=0;j<bssList->dwNumberOfItems;j++)
21.                                           {
22.                                                   wprintf(L"\t%S\n",bssList->wlanBssEntries[j].dot11Ssid.ucSSID);
23.                                           }                                   
24.                                           WlanFreeMemory(bssList);
25.                                   }
26.    
27.                           }
28.                           WlanFreeMemory(pInterfaces);
29.                   }
30.                   WlanCloseHandle(hClient,NULL);
31.                   break;
32.           case ERROR_NOT_ENOUGH_MEMORY:
33.                   wprintf(L"No hay suficiente memoria\n");
34.                   break;
35.           case ERROR_OLD_WIN_VERSION:        
36.                   wprintf(L"Version incompatible\n");
37.                   break;
38.           }       
39.           return 0;
40.   }
41.
da ist das dann aufeinmal ein Array
Code:

  for(DWORD i=0;i<pInterfaces->dwNumberOfItems;i++)

..
wprintf(L"Interface -- %s\n", pInterfaces[i].InterfaceInfo->strInterfaceDescription );
???

meine Übersetztung sieht so aus
Delphi-Quellcode:
PnduWLanInterFaceList = ^TnduWLanInterFaceList;
  TnduWLanInterFaceList = record
    dwNumberOfItems: DWORD;
    dwIndex: DWORD;
    InterfaceInfo: TnduWLanInterFaceInfo;
  end;
[edit=Luckie]Delphi-Tags durch c-Tags ersetzt. Mfg, Luckie[/edit]

Flocke 18. Okt 2006 11:19

Re: WLan API Übersetztung ?
 
Pointer kann man in C automatisch wie Arrays benutzen, sie werden als Zeiger auf das erste Array-Element interpretiert. Die korrekte Übersetzung der Struktur wäre also:
Delphi-Quellcode:
  PnduWLanInterFaceList = ^TnduWLanInterFaceList;
  TnduWLanInterFaceList = record
    dwNumberOfItems: DWORD;
    dwIndex: DWORD;
    InterfaceInfo: array [0 .. 0] of TnduWLanInterFaceInfo;
  end;

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 ?

ste_ett 19. Okt 2006 15:09

Re: WLan API Übersetztung ?
 
Die Definition für einige Typen fehlt.
z.B. "TnduDot11_SSID"


Du solltest packed records benutzen.

Delphi-Quellcode:
Txyz = packed record
  Name: Typ;
end;

nitschchedu 19. Okt 2006 15:22

Re: WLan API Übersetztung ?
 
Hier mal alle Typen

Delphi-Quellcode:

PnduDot11_SSID = ^TnduDot11_SSID;
  TnduDot11_SSID = record
    uSSIDLength: ULONG;
    ucSSID: array [0..NDU_DOT11_SSID_MAX_LENGTH] of UCHAR;
  end;

  TnduDot11_Mac_Address = record
    ucDot11MacAddress: array [0..6] of UCHAR;
  end;

  TnduDot11BssType = (dot11_BSS_type_infrastructure = 1,
    dot11_BSS_type_independent = 2,
    dot11_BSS_type_any = 3);

  TnduDot11PhyType = (dot11_phy_type_unknown = 0,
    dot11_phy_type_any = dot11_phy_type_unknown,
    dot11_phy_type_fhss = 1,
    dot11_phy_type_dsss = 2,
    dot11_phy_type_irbaseband = 3,
    dot11_phy_type_ofdm = 4,
    dot11_phy_type_hrdsss = 5,
    dot11_phy_type_erp = 6,
    dot11_phy_type_IHV_start = $80000000,
    dot11_phy_type_IHV_end = $ffffffff);

  TnduWLanRateSet = record
    uRateSetLength: ULONG;
    usRateSet: array [0..NDU_DOT11_RATE_SET_MAX_LENGTH] of SHORT;
  end;

  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;

Code:
#define DOT11_SSID_MAX_LENGTH  32      // 32 bytes
typedef struct _DOT11_SSID {
#ifndef __midl
    __range(0,32)
#endif
    ULONG uSSIDLength;
    UCHAR ucSSID[DOT11_SSID_MAX_LENGTH];
} DOT11_SSID, * PDOT11_SSID;


// These are needed for wlanapi.h for pre-longhorn targets
#ifdef __midl
    typedef struct _DOT11_MAC_ADDRESS {
        UCHAR ucDot11MacAddress[6];
    } DOT11_MAC_ADDRESS, * PDOT11_MAC_ADDRESS;
#else
    typedef UCHAR DOT11_MAC_ADDRESS[6];
    typedef DOT11_MAC_ADDRESS * PDOT11_MAC_ADDRESS;
#endif

#ifdef __midl
// use 4-byte enum
typedef [v1_enum] enum _DOT11_PHY_TYPE {
#else
typedef enum _DOT11_PHY_TYPE {
#endif
    dot11_phy_type_unknown = 0,
    dot11_phy_type_any = dot11_phy_type_unknown,
    dot11_phy_type_fhss = 1,
    dot11_phy_type_dsss = 2,
    dot11_phy_type_irbaseband = 3,
    dot11_phy_type_ofdm = 4,
    dot11_phy_type_hrdsss = 5,
    dot11_phy_type_erp = 6,
    dot11_phy_type_IHV_start = 0x80000000,
    dot11_phy_type_IHV_end = 0xffffffff
} DOT11_PHY_TYPE, * PDOT11_PHY_TYPE;

#define DOT11_RATE_SET_MAX_LENGTH              126 // 126 bytes
typedef struct _DOT11_RATE_SET {
    ULONG uRateSetLength;
    __field_ecount_part(DOT11_RATE_SET_MAX_LENGTH, uRateSetLength) UCHAR ucRateSet[DOT11_RATE_SET_MAX_LENGTH];
} DOT11_RATE_SET, * PDOT11_RATE_SET;

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;
So das waren eigentlich alle ! Ich hoffe du kannst mir Helfen.

Flocke 19. Okt 2006 15:27

Re: WLan API Übersetztung ?
 
Deine Arrays sind an etlichen Stellen ein Element zu groß. Die C-Deklaration
Code:
TYP x[5]
bedeutet in Delphi
Delphi-Quellcode:
x: array [0 .. 4] of TYP;
Z.B. an den Stellen:
Delphi-Quellcode:
ucSSID: array [0..NDU_DOT11_SSID_MAX_LENGTH] of UCHAR;
ucDot11MacAddress: array [0..6] of UCHAR;
usRateSet: array [0..NDU_DOT11_RATE_SET_MAX_LENGTH] of SHORT;
Auch mit den Aufzählungstypen könntest du Probleme bekommen - die sind in C nämlich immer 4 Byte groß und in Delphi nicht. Dafür müsstest du dann "{$MINENUMSIZE 4}" hinzufügen.

nitschchedu 19. Okt 2006 15:31

Re: WLan API Übersetztung ?
 
OK bei der MAC Adresse hate ich es vergessen aber die Anderen

Delphi-Quellcode:
NDU_DOT11_SSID_MAX_LENGTH
..
und so weiter
Habe ich schon immer eins abgezogen.
was meist du mit den Aufzählungstypen kannst da mal zeigen wie ich es richtig machen kann ?

ste_ett 20. Okt 2006 07:33

Re: WLan API Übersetztung ?
 
Einfach oben in die Unit
Delphi-Quellcode:
{$MINENUMSIZE 4}
schreiben.

nitschchedu 20. Okt 2006 10:35

Re: WLan API Übersetztung ?
 
Mal jetzt Allgemein die Übersetztung damit ich euch nicht immer auf die Nerven gehe. :wink:
Delphi-Quellcode:
ULONG                 --> ??
LONG                 --> Vieleicht LongInt ? 
UCHAR                --> ??
SHORT                --> ??
0x0000000f           --> Vieleicht $0000000f ?
unsigned int        --> ??
void *               --> War das nicht Pointer ?
unsigned long long  --> ??
unsigned __int64         --> Vieleicht Int64 ?
char                    --> Char
char *                   --> PChar
unsigned char          --> ??
union { .. }           --> Wie Übersetzt man den das ?
unsigned short           --> ??
void                     --> ?? Auch ein Pointer?
unsigned char *          --> ??
DWORD                   --> DWORD
WCHAR                   --> ??
BYTE                    --> Byte
ULONG                   --> ??
USHORT                  --> ??
BOOL                    --> Bool
BOOLEAN                 --> Boolean
ULONGLONG                --> ??
#define WLAN_READ_ACCESS   ( STANDARD_RIGHTS_READ | FILE_READ_DATA ) --> Wie Übersetzte ich das ?
PVOID                   --> ??
HANDLE                  --> THandle
LPCWSTR                 --> ??
PBYTE *                  --> Pointer auf Pointer Byte ??

__deref_out_bcount()    --> Habe keine Ahnung was das ist ??
__in                    --> Bestimmt var ?
__out                   --> Bestimmt out ?
__reserved              --> ??
__in_opt               --> ??
__deref_out             --> ??
Wenn ich das Alles Weiß Brauche ich erstmal nicht mehr so schnell Hilfe ! :bounce1:

Neutral General 20. Okt 2006 10:47

Re: WLan API Übersetztung ?
 
Zitat:

ULONG --> Cardinal
LONG --> Integer
UCHAR = unsigned char --> ka
SHORT --> ShortInt
0x0000000f --> $0000000F
unsigned int --> Cardinal
void * --> War das nicht Pointer ?
unsigned long long = ULONGLONG --> auch Longword ?^^
unsigned __int64 --> ne kein Int64 aber ka was o.O
char --> Char
char * --> PChar?^^
union { .. } --> Wie Übersetzt man den das ?

void --> ?? Auch ein Pointer?
unsigned char * --> ??
DWORD --> DWORD
WCHAR --> WideChar
BYTE --> Byte
USHORT = unsigned short --> Word
BOOL --> Bool
BOOLEAN --> Boolean
--> ?
#define WLAN_READ_ACCESS ( STANDARD_RIGHTS_READ | FILE_READ_DATA ) --> Wie Übersetzte ich das ?
PVOID --> PPointer?!
HANDLE --> THandle
LPCWSTR --> ??
PBYTE * --> Pointer auf Pointer Byte ??

__deref_out_bcount() --> Habe keine Ahnung was das ist ??
__in --> Bestimmt var ?
__out --> Bestimmt out ?
__reserved --> ??
__in_opt --> ??
__deref_out --> ??
Ehm hab mal paar Sachen zusammengefasst... Ich würde das jetzt etwa so übersetzen.. Kann das zwar selbst nicht wirklich aber so ausm Gefühl ... ka :|

Gruß
Neutral General

pacman1986 20. Okt 2006 10:53

Re: WLan API Übersetztung ?
 
void ist eigentlich für prozeduren gedacht (prozeduren nicht funktionen) wenn ich mich nicht irre

nitschchedu 20. Okt 2006 12:14

Re: WLan API Übersetztung ?
 
Soll ich da dann procedure davor schreiben oder wie ?

Klaus01 20. Okt 2006 12:17

Re: WLan API Übersetztung ?
 
void kennzeichen Funktionen ohne Rückgabewert, sind als mehr oder weniger Prozeduren

Grüße
Klaus

nitschchedu 20. Okt 2006 12:25

Re: WLan API Übersetztung ?
 
DAs ist mir Klar aber wie soll ich das in Delphi schreiben ?

Bsp:

Delphi-Quellcode:
TnduTest = record
 test1: Integer;
 test2: procedure;
end;
Das sieht doch schon beim hinsehen ******* aus.

Und so
Delphi-Quellcode:
Tprocedure = procedure ; ?
also Pointer ?

Delphi-Quellcode:
TnduTest = record
 test1: Integer;
 test2: Pointer;
end;
Oder wie ?

Waldteufel 20. Okt 2006 12:37

Re: WLan API Übersetztung ?
 
Hi Nitschchedu.

Aaaaalso:

Code:
void *abc;
wird
Delphi-Quellcode:
var abc: Pointer;
aber

Code:
void abc() {
  blabla;
}
wird
Delphi-Quellcode:
procedure abc;
begin
  blabla;
end;
Gruß,
Waldteufel

nitschchedu 20. Okt 2006 12:42

Re: WLan API Übersetztung ?
 
Na das ist doch ne Aussage ! Danke :thumb:

CodeX 3. Jan 2007 21:31

Re: WLan API Übersetztung ?
 
Zitat:

Zitat von nitschchedu
Wie Übersetzte ich den das ins Delphi ? Will nehmlich eine Unit schreiben.

:roll:

Na, warst Du erfolgreich mit Deinem Gesamtvorhaben?

Was hälst Du von dem Vorschlag, die übersetzte WLAN Unit zu veröffentlichen? Es gibt sicherlich den einen oder anderen, der dafür Verwendung hätte. Wahrscheinlich bist Du aber einer der ersten, der sich die Mühe gemacht hat.

Ich würde mich freuen. :)

nitschchedu 7. Jan 2007 19:17

Re: WLan API Übersetztung ?
 
Ja wäre kein Problem die Unit freizugeben aber einiges geht noch nicht aber mit einwenig hilfe ist das auch kein Problem. ^^

Harry M. 7. Jan 2007 19:54

Re: WLan API Übersetztung ?
 
Würdest Du bitte hier hinterlassen wo man sie dann findet. Ich mag nicht das Posting verpassen. Danke :thumb:

nitschchedu 7. Jan 2007 21:32

Re: WLan API Übersetztung ?
 
Ok Pass auf ich muss die Unit noch mal neu Schreiben der Ordnung halber. In 3 Tagen Melde ich mich wieder und Poste dir die Units OK ^^.

nitschchedu 9. Jan 2007 15:50

Re: WLan API Übersetztung ?
 
Hallo Leute jetzt brauche ich nochmal eure Hilfe

ich brauche diese Constante

Code:
#define READ_CONTROL                    (0x00020000L)
wie übersetzt ich das da hinten ein L drann ist ? Oder gibt es diese schon in irgend einer Unit ?

Hier ist mal das was ich übersetzten will

STANDARD_RIGHTS_READ = READ_CONTROL
Code:

#define WLAN_READ_ACCESS   ( STANDARD_RIGHTS_READ | FILE_READ_DATA )
#define WLAN_EXECUTE_ACCESS ( WLAN_READ_ACCESS | STANDARD_RIGHTS_EXECUTE | FILE_EXECUTE )
#define WLAN_WRITE_ACCESS  ( WLAN_READ_ACCESS | WLAN_EXECUTE_ACCESS | STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | DELETE | WRITE_DAC )

Robert Marquardt 9. Jan 2007 15:57

Re: WLan API Übersetztung ?
 
Das L heisst nur das die Zahl den Typ long int hat. Das 0x davor bewirkt das es unsigned ist. Die Zahl hat also den Typ unsigned long int.
Da int und long int beide 32 Bit sind (zumindest bei einem 32bit Compiler), kann man einfach
Delphi-Quellcode:
const
  READ_CONTROL = $00020000;
konvertieren.
| bedeutet einfach or. Wo das DELETE herkommt kann ich nicht sagen.
Schick mir uebrigens mal die .h Files und deine Konversion dann ueberarbeite ich sie. Kontakt per PM.

nitschchedu 9. Jan 2007 16:50

Re: WLan API Übersetztung ?
 
Jo mach ich warum nicht 2 Finden mehr Fehler als einer ^^. Lass mich das noch zuende schreiben.


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:44 Uhr.
Seite 1 von 2  1 2      

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