3

I'm a C++ developer who is currently writing a library in C# which has to be exposed to C++. As of now I'm using Tuples in C# to get a list of Pair of strings, which is described in the following structure.

public struct ProductInfo
{
    string ProductID;
    List<Tuple<String,String>> attributes;
}; 

I would like to expose this structure to C++. I'm expecting C++ developers to use std::pair to fill in. But I'm not sure how to Marshal the same from C++ to C#. My googling didn't give me much help. Can somebody throw some light on this?

Hari
  • 146
  • 1
  • 5

1 Answers1

0

Depending on how exactly you want the interop to work, you want either How To Marshal Structures Using PInvoke or SWIG.

user276648
  • 6,018
  • 6
  • 60
  • 86
David Seiler
  • 9,557
  • 2
  • 31
  • 39