Einzelnen Beitrag anzeigen

AliDi

Registriert seit: 3. Jul 2005
Ort: Köln
23 Beiträge
 
Delphi 2007 Professional
 
#1

C/C++ Quellcode nach Delphi

  Alt 31. Okt 2007, 17:29
Hallo,

habe folgenden C/C++ Quellcode und habe Probleme damit diesen nach Delphi umzusetzen:

Code:
 LPLINECALLPARAMS   pLCP;
 LONG               lResult;
 LPDWORD            pdwProxyRequests;

    pLCP = (LPLINECALLPARAMS)ACDAlloc(sizeof(LINECALLPARAMS) + 7*sizeof(DWORD));

    pLCP->dwTotalSize          = sizeof(LINECALLPARAMS) + 7*sizeof(DWORD);
    pLCP->dwDevSpecificOffset  = sizeof(LINECALLPARAMS);
    pLCP->dwDevSpecificSize    = sizeof(DWORD) * 7;

    pdwProxyRequests = (LPDWORD)((LPBYTE)pLCP + sizeof(LINECALLPARAMS));
    // each constant is in a DWORD at the end of LINECALLPARAMS
    *pdwProxyRequests++ = LINEPROXYREQUEST_SETAGENTGROUP;
    *pdwProxyRequests++ = LINEPROXYREQUEST_SETAGENTSTATE;
    *pdwProxyRequests++ = LINEPROXYREQUEST_SETAGENTACTIVITY;
    *pdwProxyRequests++ = LINEPROXYREQUEST_GETAGENTSTATUS;
    *pdwProxyRequests++ = LINEPROXYREQUEST_GETAGENTCAPS;
    *pdwProxyRequests++ = LINEPROXYREQUEST_GETAGENTACTIVITYLIST;
    *pdwProxyRequests  = LINEPROXYREQUEST_GETAGENTGROUPLIST;

folgendes habe ich bereits:
Delphi-Quellcode:
var
pLCP: LPLINECALLPARAMS;
gr: LongInt;
pdwProxyRequests: LPDWORD;
begin

gr:= sizeOf (TLINECALLPARAMS) + sizeOf(Integer)* 7;
getMem (pLCP, gr);

 pLCP.dwTotalSize:= sizeOf(TLINECALLPARAMS) + 7 * sizeOf(Integer);

 pLCP.dwDevSpecificSize:= sizeOf(Integer) * 7;
 pLCP.dwDevSpecificOffset:= sizeOf (TLINECALLPARAMS);

freeMem (pLCP, gr);
nur wie setze ich dieses Konstrukt um?
Code:
   pdwProxyRequests = (LPDWORD)((LPBYTE)pLCP + sizeof(LINECALLPARAMS));
    // each constant is in a DWORD at the end of LINECALLPARAMS
    *pdwProxyRequests++ = LINEPROXYREQUEST_SETAGENTGROUP;
    *pdwProxyRequests++ = LINEPROXYREQUEST_SETAGENTSTATE;
    *pdwProxyRequests++ = LINEPROXYREQUEST_SETAGENTACTIVITY;
    *pdwProxyRequests++ = LINEPROXYREQUEST_GETAGENTSTATUS;
    *pdwProxyRequests++ = LINEPROXYREQUEST_GETAGENTCAPS;
    *pdwProxyRequests++ = LINEPROXYREQUEST_GETAGENTACTIVITYLIST;
    *pdwProxyRequests  = LINEPROXYREQUEST_GETAGENTGROUPLIST;
Viele Grüße
Alidi
  Mit Zitat antworten Zitat