Find a code that compiles in 4.19 to mount pak on the fly

I’m trying desperately to find a code that compiles in 4.19.2 to load
.pak in games
the idea is to be able to load and unload modules that we do not need
in html5
for now I have to load them at startup but have to restart the browser
or relaunch a page is a terrible solution and load all the Paks in memory systematically in 2018 … it’s not great

I find this code that seems interesting to me but
he makes mistakes to me from the 3nd line

i add in my .h

#include "Net/UnrealNetwork.h"
#include "Runtime/PakFile/Public/IPlatformFilePak.h"
#include "Runtime/Core/Public/HAL/PlatformFilemanager.h"

and in myproject.Build.cs

    PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "NetworkFile", "AdditionalMap", "Sockets" });
    
    PrivateDependencyModuleNames.AddRange(new string[] { "PakFile", "StreamingFile", "NetworkFile" });

in my function:

	IPlatformFile& PlatformFile = FPlatformFileManager::Get().GetPlatformFile();
	FPakPlatformFile* PakPlatformFile = new FPakPlatformFile();

visual studio indicate a problem

expected type specifier on new FPakPlatformFile ();
and on PakPlatformFile undefined identifier

Do you have a solution
or a solution to mount .pak to fly in 4.19.2

Have you found a solution for this?

nope for now

I also have this problem. Don’t know how to fix this :confused:

apparently must use another function which is:

OnMountPak.Execute
I can not find an example or mem yet to test

i have find that