winapi - Use MATLAB Engine application without adding MATLAB to the PATH -
i working on matlab engine application. in order work, matlab needs added path environment variable engine application can find dlls (libeng , libmx).
when matlab registered com server, writes location registry , can access it. using information, there simple way allow engine application work without having add matlab path? engine application theoretically read location of these dlls registry, problem won't start without dlls (when compiled standard way, according matlab engine compilation instructions).
i not familiar winapi , not @ familiar com.
is there easy solution let problem find dlls based on information registry?
i found following solution:
if use delayed dll loading chance set dll search path before program attempts load dlls.
to this, following needed added linker options: /delayload:libmx.dll /delayload:libeng.dll , it's necessary link against delayimp.lib. after doing this, can add call setdlldirectory() path location of libmx.dll , libeng.dll beginning of main/winmain function.
Comments
Post a Comment