Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / January 2005

Tip: Looking for answers? Try searching our database.

Common Environment Object Model: getting members of a C++ base class

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Flaviu Matan - 26 Jan 2005 20:29 GMT
Hi again,

I'll try to make it short:

Given a CodeClass obtained from a C++ source file (by calling
CodeElementFromPoint(vsCMElementClass)), I call get_Bases(&CodeElementsPtr).
For each base in the colection I want to get all its member functions. The
problem is that casting any CodeElement in the bases colection to CodeClass
will result in a NULL pointer (each element in the bases is of kind:
vsCMElementVCBase) and calling get_Children on each CodeElement returns an
empty CodeElements colection.
How should one treat the elements returned by calling CodeClass::get_Bases()
(for C++ source code) in order to be able to get the base's member
functions?

Note: the cast mentioned above (from base element to CodeClass) works fine
for C# source.

Thank you,
Flaviu
Gary Chang[MSFT] - 27 Jan 2005 10:15 GMT
Hi Flaviu,

Currently I am do some research on this issue. We will reply here with more
information as soon as possible.
If you have any more concerns on it, please feel free to post here.

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.
Flaviu Matan - 27 Jan 2005 20:48 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.