I have a C++/CLI project that wraps a native C++ application, which I use in my C# project. I added a few void methods in my C++/CLI class which expose correctly to my C# project. The intellisense shows fine in C# and I can interact with the methods. However, when I put a return type of a struct in C++/CLI, the method doesn’t show as availible in C#. Any ideas?
C++/CLI
IPFILTERINFOLIST GetBlockList()
{
return _packetFilter->GetBlockList();
}
…which calls…
C++ Native
IPFILTERINFOLIST PacketFilter::GetBlockList()
{
return m_lstFilters;
}
You should create a “managed version” of the IPFILERTINFO struct and copy your unmanaged data into it. Then you create a normal .NET List<> and add all those managed objects to it.