ok - i am making some progress - thank you for the help and support guys - its is very much appreciated !
I have researched memory maps and found an example --
http://voiceofgeek.blogspot.com/2009/02/memory-mapped-file-in-delphi.html
i have created a hello world app using Delphi and here is the code
(I can load the whole project if people want to test it themselves)
I will write a version in Visual Studio when i can get the software downloaded - (Seven Smiles I upgraded VS to use Python last night and it took hours !! )
In the example below I am using a memory map called 'MMAP'
what is the RF2 memory map called ?
-------------------------------------------------------------------------------------------------------------------------------------------------
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
PRecordInfo = ^TRecordInfo;
TRecordInfo = packed record
Field1 : ShortString;
Field2 : Integer;
Field3 : Integer;
end; //TInstanceInfo
var
Form1: TForm1;
FMappingHandle : THandle = 0;
FRecordInfo : PRecordInfo= nil;
FMappingName : String = 'MMAP';
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
{ To Create a Mapping File }
FMappingHandle := CreateFileMapping($FFFFFFFF, nil, PAGE_READWRITE, 0, SizeOf(TRecordInfo), @FMappingName[1]);
FRecordInfo := MapViewOfFile(FMappingHandle, FILE_MAP_ALL_ACCESS, 0, 0, SizeOf(TRecordInfo));
FRecordInfo.Field1 := 'Value 1';
FRecordInfo.Field2 := 0;
FRecordInfo.Field3 := 1;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
{ To Open the Memory Map File }
FMappingName := 'MMAP';
FMappingHandle := OpenFileMapping(FILE_MAP_ALL_ACCESS, false, @FMappingName[1]);
{ To Read the File Contents}
FRecordInfo := MapViewOfFile(FMappingHandle, FILE_MAP_ALL_ACCESS, 0, 0, SizeOf(TRecordInfo));
edit1.Text := FRecordInfo^.Field1;//Read the Contents
edit2.Text := inttoStr(FRecordInfo^.Field2);//Read the Contents
edit3.Text := inttostr(FRecordInfo^.Field3);//Read the Contents
end;
end.