Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Mapping Shared Memory from C++

$
0
0

I'm creating a shared memory file mapping in a DLL in C++ and assign it to SM01

extern "C" {

__declspec (dllexport) char *SM01 = NULL;

}

I can use this in another C++ DLL by doing this

extern "C" __declspec(dllimport) char *SM01;

#define abc1 (*(int *)(SM01 + 4))

I can assign abc1 to a value in shared memory.

I would like to do the equivalent in a FORTRAN DLL but it's not working.  Something like this.

USE, INTRINSIC :: ISO_C_BINDING

IMPLICIT NONE

TYPE(C_PTR), BIND(C) :: SM01

SUBROUTINE FORTRAN_LIBRARY()

INTEGER abc1

EQUIVALENCE (abc1,SM01(4))

abc1 = 555

END

 

 

 

Zone: 

Thread Topic: 

Question

Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>