I have found the problem. I was trying to load a library passing the
full path to the function LoadLibrary. The problem was that this
specific library had other dependencies. So, when the dll tried to
load the dependencies it was not possible because the path (the same
path I have passed by parameter to the function) was not included in
the search paths. To fix the problem I have to call
SetCurrentDirectory before calling LoadLibrary function.
I would like to use the function SetDllDirectory, but I couldn't.
2006/2/2, PH4U <pro...@gm...>:
> Denise Vecino wrote:
>
> >Hi all,
> >
> > I'm in trouble with the LoadLibrary function. I call the
> >LoadLibrary function passing the full path of the dll and it return
> >null. The dll exist and I have already checked the path (it's
> >everything correct). I saw in the MSDN documentation that I can use
> >the function SetDllDirectory, to set the path of the dll and then call
> >the LoadLibrary... But I cannot compile my project because I got the
> >following error:
> >
> >
> >'SetDllDirectory': identifier not found, even with argument-dependent lo=
okup
> >
> > Has anyone used this function???
> >
> > Does Anyone have any idea about why the LoadLibrary is returning null=
???
> >
> >
> If I remember correct, you have to have the DLL on your PATH to load the
> DLL.
> Try setting the PATH env variable to include the DLL.
>
> --
> http://www.programminghelp4u.com/ - Help on programming (C/C++, Java, C# =
or any other programming language) for homework, assignments, course works =
and projects
>
>
|