AddComponent with C++ or analog

Hi guys, please help me, I created class that generated in the spline points static meshes, I make prototype in BP, using fuction AddComponent, but in c++ it dont use.I tried to use the information that I found on the forum, but it does not work, how do I build this logic?
Video with prototype and C++ code : - YouTube
Very hope on your help, best regards, your friend, Alex.
p.s. sorry for my english, it’s not my native language.

I’m not sure I fully understand what you want. The documentation for AddComponent is here for C++: AActor::AddComponent | Unreal Engine Documentation

If you’re still having troubles could you post an the code you have so far (or a similar example) so we can see what you already have and fix any easy errors? thanks

Thx for your answer, I dont understand AddComponent() can be used in c++? I thought it only appropriate to use in BP. If it’s true, can u write example of code(add static mesh component, for example)
p.s. I tried: AddComponent(FName(“Mesh”), false, GetActorTransform(), UStaticMeshComponent::StaticClass());

If you want examples (the above is a C++ interface, but I can’t find anyone using it) this one is probably more helpful. https://docs.unrealengine.com/latest/INT/Programming/Tutorials/Components/1/

or if you need it at runtime What is the correct way to create and add components at runtime ? - C++ - Epic Developer Community Forums

Problem was solved, logic was is right, but in construction wrong display.