How to dynamically embed Julia in a Windows app

I think I solved it for my case!

This substitutes for the LoadLibraryA() call in my example:

    SetCurrentDirectoryA(libdir);
    hDLL = LoadLibraryExA(fulllibpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);

where libdir is the path to the /bin folder and fulllibpath is that + “libjulia.dll”.

I think it is also possible to do it with AddDllDirectory() and then LoadLibraryExA(fulllibpath, NULL, LOAD_LIBRARY_SEARCH_USER_DIRS) but AddDllDirectory() requires a wide/Unicode string and I’d rather avoid the complication.