I do want to access the array elements. The code snippet I gave was just a
cutdown version of the procedure. I am able to sucessfully access every
element in the array, but the problem is freeing.
Any suggestions on how I would "roll-my-own" dynamic array?
Thanks
Stacey
> -----Original Message-----
> From: Paul Spain [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 27 February 2001 1:32 p.m.
> To: Multiple recipients of list delphi
> Subject: Re: [DUG]: C Header conversion problems.
>
>
> Hi Stacey,
>
> Dynamic arrays (LProcessInfo) are a Delphi-only construct.
> Its very unlikely
> the the C-based memory allocation will work properly. (Not to
> say you can't do
> dynamic arrays in C. Array support in C is much cleaner than
> Delphi IMHO). I
> assume from your code that you don't want to access the array
> elements? (As
> you
> free it immediately). If you do, you'll need to roll your own
> dynamic array
> solution, like pre-D4 days.
>
> This should satisy the requirements of the
> WFEnumerateProcessesA() call:
>
> procedure TForm1.Button1Click(Sender: TObject);
> >
> > var
> > LProcessInfo: PWF_PROCESS_INFO;
> > LCount: DWord;
> > begin
> > if EnsureWFAPIDLLLoaded then begin
> > if WFEnumerateProcessesA(WF_CURRENT_SERVER_HANDLE,
> > 0, // reserved
> > 1, // version 1
> > LProcessInfo,
> > LCount) then begin
> > WFFreeMemory(LProcessInfo);
> > end;
> > end;
> > end;
>
>
>
> Paul.
> ----------------------------------------------------------
> Paul Spain, Excellent Programming Company
> mailto:[EMAIL PROTECTED]
> ----------------------------------------------------------
>
> --------------------------------------------------------------
> -------------
> New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"