is there anything in VC can do the job like Reflection in .NET?

R

Ryanivanka

hi,
is there anything in VC can do the job like Reflection in .NET?
i mean by setting some attribute and get runtime information?
 
C

Carl Daniel [VC++ MVP]

Ryanivanka said:
hi,
is there anything in VC can do the job like Reflection in .NET?
i mean by setting some attribute and get runtime information?

No. Reflection is a platform capability provided by the CLR and there is
nothing equivalent for native C/C++. The closest you can come with built-in
language features is dynamic_cast - which is to say, not very close.
There's no way to inspect an object and determine it's methods and fields,
for example. Leaving the realm of pure C/C++, COM provides some
reflection-like abilities for COM classes that are described by a type
library, but again, that's a platform feature of COM, not a native C/C++
feature.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top