Re: How to load DLL from a specific folder



Finn Tolderlund wrote:

>
> "Andy" <andy@xxxxxxxxxx> skrev i en meddelelse
> news:433cbd86@xxxxxxxxxxxxxxxxxxxxxxxxx
> > I have a .pas wrapper for a C++ dll. Currently, it is compiled into the
> > application where it would bombed out without the presence of the dll. How
> > do I make my application load the dll from a specific folder in my code?
> And
> > how do I use my .pas wrapper in this particular case?
>
> You will have to use use dynamic loading of the dll. With LoadLibrary you
> can specift exact path of the dll.
> For examples search google groups for
> LoadLibrary GetProcAddress FreeLibrary

Be aware that sometimes this can create lots of trouble if this DLL is linked
against other dll which are in a different in the path. To solve this you need
to set the CurrentDir to the directory you want to load the DLLs from BEFORE
you call LoadLibrary.

--

Hannes Danzl [NexusDB Developer]
Newsgroup archive at http://www.tamaracka.com/search.htm
.



Relevant Pages

  • Re: running a service/driver/application upon startup
    ... debug version of the image is too large to load onto the device. ... I ran dumpbin/exports on the finger dll and saw the required function names: ... > theories as to why it's not getting loaded but just doing 'services load ...
    (microsoft.public.windowsce.embedded)
  • Re: Unable to load custom driver on WinCE 6
    ... I'm trying to make and load a simple DLL on WinCE 6 by following the ... I've made a subproject at PB project to include the simple DLL ... At the target device, the mydriver.dll file is in the Windows ... I wrote a simple application to load the driver dynamically ...
    (microsoft.public.windowsce.embedded)
  • Re: Cannot activate sbcl
    ... but I think what happens is that Windows sees that your executable has a DATA section that might overlap a DLL's address space then it would reallocate that DLL to different address space. ... VirtualAlloc dynamically in your code is that your program and all its ... What can be done here is to have many tiny executables with different BSS sections in them, which then load a bigger executable in the form of a DLL. ...
    (comp.lang.lisp)
  • Re: DLL load should be easy, but errors
    ... But I cant load even the simple DLL I ... Just supply the exe with the path to the DLL I showed. ... foreach (Type typ in types) ... 'typ.GenericParameterAttributes' threw an exception of type ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Loadlibrary returns err.lastdellerror 127
    ... the resulting .exe I load all the dependant DLL's first (there are ... Assuming this is a 'regular' Dll and not an ActiveX Dll. ... you do NOT need to 'load' all the dependant Dlls. ... Actually the declare statements are there as well. ...
    (microsoft.public.vb.general.discussion)