Hi,
I was actualy hoping to get the members of a base class (for C++ source
code) by using only the EnvDTE namespace. It works for C# but I was not able
to work it out for C++ without using the VCCodeModelLibrary namespace.
For anyone interested I will describe how this can be achieved (get the
members of a base class obtained by iterating through the CodeElements
returned by calling CodeClass::get_Bases()):
C#:
- cast each CodeElement in bases elements to CodeClass and call
CodeClass::get_Members(). It works.
C++:
- for each CodeElement in bases do the folowing:
VCCodeBasePtr vcBase = baseCodeElem; //baseCodeElem is a CodeElementPtr
contained in the CodeElementsPtr returnes by CodeClass::get_Bases()
CodeTypePtr baseClass;
vcBase->get_Class(&baseClass);
if(baseClass)
{
baseClass->get_Members(&baseMembers); //baseMembers will hold the
base class' members
}
Thank you,
Flaviu
> Hi Flaviu,
>
[quoted text clipped - 11 lines]
> Get Secure! ??C www.microsoft.com/security
> Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
> &SD=msdn
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
Gary Chang[MSFT] - 29 Jan 2005 06:09 GMT
Hi Flaviu,
>I was actualy hoping to get the members of a base class (for C++ source
>code) by using only the EnvDTE namespace. It works for C# but I was not able
>to work it out for C++ without using the VCCodeModelLibrary namespace.
>For anyone interested I will describe how this can be achieved (get the
>members of a base class obtained by iterating through the CodeElements
>returned by calling CodeClass::get_Bases()):
Since the VC code model is somehow different from other .NET languages,
after some researchs I don't find the method to get the members of a C++
base class under EnvDTE namespace.
Thanks for your understanding!
Best regards,
Gary Chang
Microsoft Community Support
--------------------
Get Secure! ??C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn
This posting is provided "AS IS" with no warranties, and confers no rights.