简体   繁体   中英

How to determine method parameter types during runtime in C/C++ under .NET?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM