Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
要从 c# 中的类型获取程序集,我将使用以下内容
typeof(MyTypeOrClass).Assembly
但是我如何在 C++ 中实现这一点?
您可以使用“typeid”来做到这一点:
using namespace System; namespace NS { public ref class Foo { }; } int main() { System::Reflection::Assembly^ a = NS::Foo::typeid->Assembly; Console::WriteLine(a); }