mergedlo.dll missing cpp program

Hello,

I am writing an interface to drive libreoffice (7.x.x) from our software.
I use :
WINDOWS 10
VISUAL STUDIO 2015
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 ‘unoidl.com.sun.star.frame.XDesktop’.

    unoidl.com.sun.star.lang.XMultiComponentFactory xAppFactory = xAppContext.getServiceManager();
  
    Object oDesktop =xAppFactory.createInstanceWithContext("com.sun.star.frame.Desktop", xAppContext);
   
        Console.WriteLine(oDesktop); 
        reutrn the value--> Uno object proxy. OID:a64e448;msci[0];33f984b91b24c92b9be501ebcc8a0ca
   
    unoidl.com.sun.star.frame.XDesktop xDesktop = (unoidl.com.sun.star.frame.XDesktop)oDesktop;

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