C++/CLI: wrapping the same unmanaged object in multiple managed objects
问题 I am developing a library which has two layers, unmanaged (C++) and managed (C++/CLI). The unmanaged layer contains the logics and the computation algorithms, while the managed layer provides interface and visualisation to a .NET-based host application. A class in the managed layer wraps its class counterpart in the unmanaged layer, e.g. ManagedA wraps UnmanagedA and ManagedB wraps UnmanagedB. Classes in the unmanaged layer have query methods, suppose UnmanagedA::B() returns an instance of