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"

Reply via email to