Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Mar : Problem with ReadProcessMemory

www.cryer.info
Managed Newsgroup Archive

Problem with ReadProcessMemory

Subject:Problem with ReadProcessMemory
Posted by:"Gerhard Venter" (gerhard.vent..@comtronic.com)
Date:Mon, 28 Mar 2005 15:26:55

The compiler gives me the following error:

[Error] MemoryUtils.pas(97): E2033 Types of actual and formal var parameters
must be identical

function GetFloat(vAddress : Integer) : Single;
var
  hProcess : THandle;
  lpBuffer : Single;
  nSize : Integer;
begin

  nSize := 4;
  hProcess := OpenProcess(PROCESS_VM_READ, False, ProcessID);
  ReadProcessMemory(hProcess, @vAddress, @lpBuffer, nSize, 0);
<====== Error on this line
  Result := lpBuffer;
  CloseHandle(hProcess);

end;

What am I doing wrong? ProcessID is declared and is set when I call this
function.

Thanks.

Replies:

www.cryer.info
Managed Newsgroup Archive