I do not know why you are having problems.
In your original post, you said:
You have not said what is wrong, or how it is wrong.
Nor have you said what you expected from the code.
Just a note: A ComponentInstance does not “have” any faces.
Only a ComponentDefinition has an entities collection.
In SketchUp models, the component instance can be painted with a material, which will render (for this instance only,) upon all the child faces of the component’s definition, if they do not have their own material assignments.
So if a certain face needs a unique texture mapping, then the material must be assigned directly to the face, and this material object will need to be unique for this face. It cannot be shared even if the original texture image file was the same as that used by other faces, or other components at the instance level.
Also, I myself do not care for C or C++ language, and do not program in it, (but can read and understand the idea of what the code is doing,) … but I cannot help much if it is C language nitty issue.
As you say, the component instance can be painted with a material. I want to know how the texture of material is mapped to the object and get the mapping uv. When i use the uv from SUMeshHelperGetFrontSTQCoords and set to my scene, the texture looks too dense when compared to the scene in SketchUp (refer to the image i upload before). @DanRathbun