You cant treat a PWF_PROCESS_INFO as an array (in Delphi 4 at least).
 
Any form of pointer arithmetic would do the job, but I am having trouble sorting out the type casts.
 
Stacey
-----Original Message-----
From: Nello Sestini [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 27 February 2001 2:13 p.m.
To: Multiple recipients of list delphi
Subject: Re: [DUG]: C Header conversion problems.

 
----- Original Message -----
Sent: Tuesday, February 27, 2001 04:13
Subject: [DUG]: C Header conversion problems.

I have a DLL written in C which is an interface for Citrix Metaframe.
The DLL cam with a C header file, which I have converted (using Dr Bobs header converter and some tweaking) to Delphi but I have problems.
 
how about if you do it like this:
 
procedure TForm1.Button1Click(Sender: TObject);
var
  pProcessInfo: PWF_PROCESS_INFO;
  LCount: DWord;
begin
  if EnsureWFAPIDLLLoaded then begin
    if WFEnumerateProcessesA(WF_CURRENT_SERVER_HANDLE,
        0,    // reserved
        1,    // version 1
        pProcessInfo,          
        LCount) then begin
      WFFreeMemory(pProcessInfo);       
    end;
  end;
end;      
 
you can still use [] with pProcessinfo just as you are now
doing with the array.
 
but (I think) dynamic arrays use Delphi reference counting
stuff and pointers don't, and that may be the problem.
 
i'd be interested to hear if this also has the leak behaviour.
 
-ns

Reply via email to