How to create a material using a texture in c++?

@SolidGasStudios, thank you very much , it works!!!