What is the best practice of sharing memory structures from a C # program in a C ++ win32 DLL?
I used structures in managed shared memory using Boost between two C ++ programs, and it worked fine. I have lost the best way to accomplish this between where the structure is populated in a C # program and a C ++ DLL, which is a SNMP subagent.
Here's the C ++ DLL:
//==================== Code Excerpt from the main cpp file ======================
Here's the calling C # function:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; namespace sharedMemTestCS { public partial class frmSharedMemTestCS : Form { struct sharedData { int sharedA; int sharedB; }; static sharedData A;
The error message I get is:
Error 1 Inconsistent accessibility: return type
'sharedMemTestCS.frmSharedMemTestCS.sharedData' is less accessible than the method 'sharedMemTestCS.frmSharedMemTestCS.getMyData ()' c: \ documents and settings \ mconrad \ my documents \ visual studio 2010 \ Projects \ sharedMemTestCS \ sharedMemTestCS \ Form1.cs 23
source share