Tips: How do I...
Posted: Tue Aug 25, 2015 6:40 am
This is a topic about random things that you can do in C++ that are not obvious.
How do I... Iterate over all objects that are relevant to me?
How do I... Convert a "FString" into const TCHAR*? (useful for logging)
How do I... Convert a const TCHAR* to FString?
How do I... Load an arbitrary class?
...More to come.
How do I... Iterate over all objects that are relevant to me?
Code: Select all
for( TObjectIterator O; O; ++O )
{
}//Iterate over all UObjects.
Code: Select all
FString F= FString::Printf(TEXT("%s"),TEXT("nedm"));
GLog->LogF(TEXT("%s"),*F);
//the "*" operator on FString converts your FString into a const TCHAR.
How do I... Convert a const TCHAR* to FString?
Code: Select all
const TCHAR *Str = TEXT("nedm");
FString F= FString::Printf(TEXT("%s"),Str);
Code: Select all
(UTexture *)StaticLoadObject(UTexture::StaticClass(), NULL,TEXT("Engine.S_Actor"), NULL,LOAD_NoWarn | LOAD_Quiet,NULL);//Load Engine.S_Actor texture.
...More to come.