mergedlo.dll missing cpp program


I am writing an interface to drive libreoffice (7.x.x) from our software.
I use :
SDK LO 7.01
Portable LO 7.01

I try with a cpp and a c# program too.

I have two problems:

  1. My program stops because it cannot find the mergedlo.dll

When I profile with PROCMON, it seems that it is looking for this dll at the root of the drive. For example, if libreoffice is installed on c: \ program files \ libreoffice, the dll is looked for on c: if libreoffice is installed on e: \ libreoffice, the dll is looked for on e: On the other hand it does find the dlls of the sdk cppu3 .dll, sal3.dll.
Mergedlo.dll is present in the libreoffice\program folder.

I try to add system variables (uno_path,ure_path,office_path) and ini files but without success.

  1. If I bypass point 1 my program crashes

If I copy mergedlo.dll to the expected location, my program returns the error :

System.InvalidCastException: Impossible d’effectuer un cast du proxy transparent en type ‘’. xAppFactory = xAppContext.getServiceManager();
    Object oDesktop =xAppFactory.createInstanceWithContext("", xAppContext);
        reutrn the value--> Uno object proxy. OID:a64e448;msci[0];33f984b91b24c92b9be501ebcc8a0ca xDesktop = (;

I don’t know if it can be related to the fact that I bypassed 1).

Thank you for your help .

I resolve problems: I add the environnement variable URE_BOOTSTRAP=file:///D:\Software/…/program/fundamental.ini