How to get a Editor Standalone Windows plugin reference

Hey, I’m struggling to get a reference in my game code to a plugin that I created.using the Editor Standalone Window plugin template. The find plugin function seems to correctly return my plugin when I breakpoint it however I need to cast it (I assume?) in order to get access to my plugins functions/data etc but a normal cast gives me the error at the bottom. Seems the Cast may only be for UObjects in which case I’m not sure how I get a reference to my plugin.

TSharedPtr<IPlugin> aPlugin = IPluginManager::Get().FindPlugin("myplugin");
Fmyplugin* myPluginvar = Cast<Fmyplugin>(aPlugin.Get());

Severity Code Description Project File Line Suppression State
Error C2664 ‘To *TCastImpl<From,To,ECastType::UObjectToUObject>::DoCast(UObject *)’: cannot convert argument 1 from ‘From *’ to ‘UObject *’ TestProject C:\Program Files\Epic Games\UE_4.21\Engine\Source\Runtime\CoreUObject\Public\Templates\Casts.h 193

Solution is:

FMyModule myModuleVariable = FModuleManager::Get().GetModulePtr(“MyModule”);