Problem in mapping file into process's address space 
Author Message
 Problem in mapping file into process's address space

I have an array saved to a file. I map the file to process's address space
using function MapViewOfFile. In C I can do this as follows:

        { float a[10];
          ...
          a=(float*)MapViewOfFile(...);
          // Now I can manipulate the array in the file
          a[1]=10;
          ...
        }
But in Pascal I must use pointers:

        type
        Tarr=array [1..100] of single;
        Tp=^Tarr;
        var p:Tp;
        begin
        ...
        p:=Tp( MapViewOfFile(...) )
        //Now to do the same assignment than in C above I must write:
        (p^)[1]:=10;

Is there any way to do this in Pascal same way than in C.
I can do in Pascal the following:

        var a:Tarr;
        begin
        ...
        p:=Tp( MapViewOfFile(...) ); a:=p^ ; a[1]:=10;

But problem is that this does not change the values in the file.          



Sat, 05 Feb 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. DPMI physical address mapping (VESA linear frame buffer)

2. FreePascal Physical -> Linear address mapping (VESA)

3. FreePascal Physical -> Linear address mapping (VESA)

4. Can't seem to compare spaces fields...

5. Windows process's

6. Get function's address into LongInt?

7. Need Jaime's Address

8. Getting a method's address

9. Getting a method's address

10. FPC Win32 memory mapped files for IPC

11. TP6, Overlay, Map files

12. FPC Win32 memory mapped files for IPC

 

 
Powered by phpBB® Forum Software