0

To get an assembly from a type in c# I'd use the following

typeof(MyTypeOrClass).Assembly

But how do I achieve this in C++?

Sam
  • 28,421
  • 49
  • 167
  • 247

1 Answers1

1

You can do it by using "typeid":

using namespace System;

namespace NS
{
  public ref class Foo
  {
  };
}
int main()
{
  System::Reflection::Assembly^ a = NS::Foo::typeid->Assembly;
  Console::WriteLine(a);
}
Jochen Kalmbach
  • 3,549
  • 17
  • 18