Re: [fpc-devel] Convert C++ Array[1] to FPC

2008-02-24 Thread Sooky Boo
Thanks for all the help already working :), realized after last email, getmem allocates enough memory regardless of what sizeof() says. Hopefully this will help someone in future with the same type of question. After the function returns (and populates SSLPROTOCOLS) dwCount is the amount of elem

Re: [fpc-devel] Convert C++ Array[1] to FPC

2008-02-24 Thread Bram Kuijvenhoven
Sooky Boo wrote: I put the function in a for loop and passed I as the size paramater until it succeeded, the size of the structure it expects is 40. BTW what is the value of dwCount? 40 is equal to GetMem(sizeOf(SSLPROTOCOLS) + (2) * sizeOf(SSLPROTOCOL)); Indeed. so protocols := LPSSL

Re: [fpc-devel] Convert C++ Array[1] to FPC

2008-02-24 Thread Sooky Boo
I put the function in a for loop and passed I as the size paramater until it succeeded, the size of the structure it expects is 40. 40 is equal to GetMem(sizeOf(SSLPROTOCOLS) + (2) * sizeOf(SSLPROTOCOL)); so protocols := LPSSLPROTOCOLS(GetMem(sizeOf(SSLPROTOCOLS) + (2) * sizeOf(SSLPROTOCOL)));

Re: [fpc-devel] Convert C++ Array[1] to FPC

2008-02-24 Thread Bram Kuijvenhoven
Sooky Boo wrote: On 2/23/08, ik <[EMAIL PROTECTED]> wrote: {$PACKRECORDS C} On Sat, Feb 23, 2008 at 5:59 AM, Sooky Boo <[EMAIL PROTECTED]> wrote: Please help I am unsure how to port from C++ to fpc this code. The function this must be passed to says that the structure pointer or size is inv

Re: [fpc-devel] Convert C++ Array[1] to FPC

2008-02-23 Thread Sooky Boo
On 2/23/08, ik <[EMAIL PROTECTED]> wrote: > {$PACKRECORDS C} > ... > type > LPSSLPROTOCOL = ^SSLPROTOCOL; > SSLPROTOCOL = record > dwProtocol : DWORD; > dwVersion : DWORD; > dwFlags : DWORD; > end; > _SSLPROTOCOL = SSLPROTOCOL; > > > On Sat, Feb 23, 2008 at 5:59 AM, Sooky Boo <[EMAIL PROTECTED]> wr

Re: [fpc-devel] Convert C++ Array[1] to FPC

2008-02-23 Thread ik
{$PACKRECORDS C} ... type LPSSLPROTOCOL = ^SSLPROTOCOL; SSLPROTOCOL = record dwProtocol : DWORD; dwVersion : DWORD; dwFlags: DWORD; end; _SSLPROTOCOL = SSLPROTOCOL; On Sat, Feb 23, 2008 at 5:59 AM, Sooky Boo <[EMAIL PROTECTED]> wrote: > > > Please help I am unsure h

[fpc-devel] Convert C++ Array[1] to FPC

2008-02-22 Thread Sooky Boo
Please help I am unsure how to port from C++ to fpc this code. The function this must be passed to says that the structure pointer or size is invalid. C++ typedef struct _SSLPROTOCOL { DWORD dwProtocol; DWORD dwVersion; DWORD dwFlags; } SSLPROTOCOL, FAR *LPSSLPROTOCOL; typedef