Sign in to follow this  
Followers 0
Sardith

Shared Memory

1 post in this topic

The shared memory content can be read by using a similar code like the following Delphi procedure:

Const
 sharedmem_name = 'EVEREST_SensorValues';

Function  ExtApp_SharedMem_ReadBuffer(bu:PChar;bu_size:DWord):Boolean;

Var
 mappedData : PChar;
 th : THandle;

Begin
 Result:=False;

 th:=CreateFileMapping(INVALID_HANDLE_VALUE,0,PAGE_READONLY,0,bu_size,sharedmem_name);

 If th<>INVALID_HANDLE_VALUE Then
 Begin
   mappedData:=MapViewOfFile(sharedmem_handle,FILE_MAP_READ,0,0,0);
   If mappedData<>Nil Then
   Begin
     StrLCopy(bu,mappedData,bu_size);
     If UnmapViewOfFile(mappedData) Then Result:=True;
   End;
   CloseHandle(th);
 End;
End;

Is it possible to do something like that? If so could someone help me with a start?


[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0