I am wrapping a native C++ library for consumption by the CLR. However, I'm running into a strange... problem?
The native library's headers look like so:
namespace Foo {
class Bar {
public:
Bar();
//etc...
};
}
So, to consume this class, I have my own class definition:
#include "Foo/Bar.h"
namespace FooNet {
public ref class Bar {
private:
Foo::Bar * m_Impl;
internal:
Bar(Foo::Bar *);
//etc...
};
}
And, that all works great. However, when I reference the resulting assembly into a C# project (for example) and look at the object browser, I notice that it contains not only my CLR classes (FooNet::Bar
), but also the native classes (!Foo::Bar
) too
I'm not particularly enthusiastic about exposing the native classes, since they use pointers and std::string
s and other .NET unfriendly stuff, so is there any way to stop this from happening?
Edit: Things I learned today:
- The object browser shows all namespaces in the solution, not in just whatever project you happen to be looking at.
- Native C++ classes are not exposed in managed assemblies.