Is it possible to get the particle color and particle position in C++

Hi,
I am trying to get the particle position and particle color in my C++ class where I create a material for the particle system. Somehow, the particle position and color which I obtain are the default values. I am using UMaterialexpressionParticlePositionWS and UMaterialExpressionParticleColor in my C++ class. Is there something that I am missing?