Posts

Showing posts from July 2, 2019

Create Blueprint Library, print to log and using windows.h in a Unreal Engine C++ project

When you need to use some specific Windows API functions, such as LoadLibrary for loading DLL, or CreateFileMapping for using shared memory, you need to use #include <windows.h> in your project's C++ code. To be sure all building successfully, please insert this with "WIN32_LEAN_AND_MEAN" define, and use it as early as possible (I use it as the second #include in CPP code): #include "MyBlueprintFunctionLibrary.h" #define WIN32_LEAN_AND_MEAN #include <windows.h> For advanced capabilites, such as using GEngine class, it's required to include "Engine.h" . It's required to do before including <windows.h> : #include "MyBlueprintFunctionLibrary.h" #include "Engine.h" #define WIN32_LEAN_AND_MEAN #include <windows.h> Here is example how to load DLL using Windows API in Blueprint Function Library C++ class. Also, it demonstrates print to screen and to log in Unreal Engine C+