From: Brian D. <br...@de...> - 2007-04-17 17:28:54
|
> Dimitry Kloper wrote: > 1. Link with absolute path to perl58.dll. Not quite good since the > exact location of the dll is > defined in the installation time I'm pretty sure you can't embed the actual absolute path to a DLL when linking, just the name of the DLL. > 2. On XP and Win2003 it is enough to put my dll and perl58.dll in the > same directory. > Works well, but I am still having problem on Win2000. Right now the > only way to affect > dll loading path is altering the PATH environment variable. My goal is > to avoid using PATH > because of security reasons. Look at the MSDN docs for LoadLibrary for the details on all the things that affect the DLL search order. > 3. Well, now the question: MSDN says that it is possible to affect the > dll loading mechanism by > embedding a manifest file as a dll resource. Does anybody have an > example or reference to > example of such an embedding? Is it possible with MinGW tools at all? Sure, just create your XML manifest file, then reference it in your resource file, e.g.: #include "windows.h" ... CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "foo.exe.manifest" ... Then compile the .rc file into an object file (.o) with windres: %.o: %.rc $(WINDRES) -o $@ $< And just add that object to the link command. If you need examples of the .rc syntax, it's all documented on MSDN and/or the PSDK and you can use the format almost verbatim. Brian |