Thank you @ferdinand . Sorry for my confused explanation, but yes, you understand perfectly correctly: I need to update the plugin file on the clients machine when the update-file is ready on my web-server.
Right now I am able to send the message into my plugin instance from my server. My plugin listening my web-server and in some moment receives the message that the update is available. When plugin instance got this message, it starts the code function quoted above (i.e download the new .xdl64 file).
So I can build the updates system through the notification to the client with the request to install this update manually. But I want to make it more easily and unnoticed by the client.
Right now I've tried to simple replace my plugin-file (.xdl64) during C4DPL_ENDPLUGINACTIVITY2 via
std::filesystem::copy_file(from, to, overwrite_existing);
But I got the error and had not success.
It seems that the .xdl64 file is still in use when C4DPL_ENDPLUGINACTIVITY2 make a call. During debugging I just got an error from <filesystem> and "plugin.xdl64" remain the same, which is understandable if the file is still in use:)
So I will try your advice with the storing the data from new one .xdl64 to a Char*. But I have a doubt will it help if the .xdl64 is still busy during C4DPL_ENDPLUGINACTIVITY2.
Thank you again @ferdinand .