- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've been working on a project where I'm trying to replicate some aspects of an application (originally written using c++ and fortran) using c# and fortran. One of the function I'm trying to replicate is passing information from a memory mapped file to c# to fortran and vice versa.
I've been able to create the memory mapped files in c#, but what I'm struggling with is the data sharing. In the original application, we were able to create the memory mapped files, and then pass a pointer to a double array to the fortran, which was then able to read and write to that array. To try to replicate this in c#, I loosely followed the solution posted here: https://stackoverflow.com/questions/31179076/how-to-get-an-intptr-to-access-the-view-of-a-memorymappedfile.
It appears that the function I'm passing the pointer to in the fortran is receiving the correct data, but when I try to read or write to that array I get an access violation exception. Should I be doing this differently?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you provide simplified and only essential example code for the mmf use? There are several possible explanations with the info given

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page