# GUI/Canvas/Pointer/C++ Issues!

**URL:** <https://forums.unrealengine.com/t/gui-canvas-pointer-c-issues/4257>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [May 13, 2014, 4:57am UTC](https://forums.unrealengine.com/t/gui-canvas-pointer-c-issues/4257 "2014-05-13T04:57:55Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [May 13, 2014, 11:12pm UTC](https://forums.unrealengine.com/t/gui-canvas-pointer-c-issues/4257/2 "2014-05-13T23:12:16Z")

</div>

Logs

The first thing to do is start using UE\_LOG

**I have entire Wiki Tutorial here:**

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

```auto

**OnScreen Log Messages**

You can also use onscreen debug messages:

**wiki link**
https://wiki.unrealengine.com/Logs,_Printing_Messages_To_Yourself_During_Runtime#Logging_message_to_the_screen

```

once you get your own Log setup,

add logs here

```auto

void ASSHUD::PostInitializeComponents()
{
    Super::PostInitializeComponents();

**UE_LOG(YourLog,Warning,TEXT("My Very Special HUD Class: PostInit Did Run, Yaaaaay!"));**

    //Grab the PC
    ThePC = GetOwningPlayerController();

    //If the PC isn't null
    if (ThePC != NULL)
    {
        //Grab the custom player controller
        ASSPlayerController* YourChar = Cast<ASSPlayerController>(ThePC);

        //If the custom controller isn't null
        if (YourChar != NULL)
        {
            **UE_LOG(YourLog,Warning,TEXT("HAPPY HAPPY SUCCESS>>>> Hiiiiiiiiiiiiiiiiii Loken!!!!"));**
            //Set it to the global var
            SSPC = YourChar;
        }//if
    }//if    

    //How to Get The Character
    //ASSCharacterClass* YourChar = Cast<ASSCharacterClass>(GetOwningPawn());

}//PostInitializeComponents

```

If you see the message in blue in your log, or print yourself an onscreen message

then you know that this code ran successfully

otherwise, you’ve narrowed down the issue: the Casting to your custom PC is not working

🙂

```auto

No matter what you should see the Post Init Ran Yaaaay!!! message in your log

if you dont, well then you need to figure that out first :)

Rama
```

---

_[View the full topic](https://forums.unrealengine.com/t/gui-canvas-pointer-c-issues/4257)._
