Just forget about the way how your EXE is linked to DLL.

If the linked DLL is yours, the code for loading/unloading external resource DLL must be in the DLL that external resources are intended for, and the code will be pretty much the same to what you quoted.

If the DLL is not yours, you are not able to control the way how it handles resources. With all the consequences.

In case the external resources are intended for both EXE and DLL, the resource handle may be controlled by EXE code which will propagate the changed module handle to the linked DLL as well. Of course, the linked DLL must be designed to accept the changes.