getting component names using SolidWorks API

I am using Solidworks API in VC++ 6.0. How can I get the parts' names in an assembly file? I could find there are some functions like
"getComponents"... but not sure whether they are the correct ones I should use.
Thanks!
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
There is an example in the API help that shows exactly how to do this.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
I use VB not C++, so you will have to translate, but here is the The following shoud do it:
1. use GetComponents 2. cycle through each component in the groups of components 3, use component2.name2 or component.getpathname 4. if you want to "work" the the modeldoc object of the component, then you can use component2.getmodeldoc or activatedoc or opendoc

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
thank you!
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.