How do i properly use CreateWidget in 4.7.6

i am using 4.7.6 and i am trying to add a MyUserWidget class using CreateWidget(…,…) but i keep on getting errors…im not sure what the proper syntax is now. I get build errors every time i try it, id appreciate an example of how to properly implement this. Thanks.

I used this tutorial to get it working : [TUTORIAL/SNIPPET] Creating a UMG Widget in C++, and delegate example - Programming & Scripting - Epic Developer Community Forums

ive used that tutorial the problem i am having is that when i need to check
if(InventoryUIClass)
it is always NULL so it never creates the widget and when i dont use the check it just freezes on play.

im not sure if im missing something or if i have to instantiate it somehow