views:

25

answers:

1

Hi all,

in C# it is possible by using reflection to determine parameter types of some method as well as class members (method, properies..). I suppose that this is possible because of IL and .NET technology, right ? If so is it possible to use reflection or some similar technique for C/C++ writen under Visual studio 2005/2008/2010 .NET ?

br, Milan.

A: 

It is possible because of metadata in an assembly, put there by the compiler. And an extensive API that allows reading that data. And the essential Object.GetType() method and typeof keyword.

None of which is available in a C or C++ compiler. You could hack around this a bit with RTTI and reading the debug symbol file. I doubt it's worth the effort.

Hans Passant
That means that C/C++ compiler under .NET does not contain more simbols/types as old one (Visual Studio 6) ?
milan
That's what it means. It however *does* support the /clr option. That compiles C++/CLI, an entirely different language.
Hans Passant