Get the Mouse Position In my Own Lib

I use a external static lib to get the mouse position. The lib works in general C++ project . But in UE4 , I can only get the mouse data in the first frame.
Can anyone tell me the reason?
best wishes!