LoadLibrary finds 'no more files' ?!

Started by
3 comments, last by Empirical 19 years, 6 months ago
i've got a very strange problem here dealing with native packages for my programming language. i'm using shared objects (aka dlls under windows) to give access to special classes during runtime delivering the functionality needed for code written in that language. under linux this works just find but under windows i get a really strange problem. only with some dlls (don't know why) the LoadLibrary() fails and GeLastError() returns ERROR_NO_MORE_FILES. WTF has LoadLibrary to do with this error message which belongs to FindFirstFile/FindNextFile?? please help... i can't fully port my language if windows keeps choking on some of dlls and not on others.

Life's like a Hydra... cut off one problem just to have two more popping out.
Leader and Coder: Project Epsylon | Drag[en]gine Game Engine

Advertisement
Never had problems with LoadLibrary.

Are you specifying full paths?
MSDN also states that "It is not safe to call LoadLibrary from DllMain."

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

i load it with full path and all. also i don't call it from a dllmain as i have no such function at all (mind it's crossplatform design).

i don't think it makes a difference but i use MinGW to compile this thingy. but that should not have any influence.

i just can't figure out how this error can come.

Life's like a Hydra... cut off one problem just to have two more popping out.
Leader and Coder: Project Epsylon | Drag[en]gine Game Engine

nobody has an idea? i'm kinda cut off unless i can solve this issue.

Life's like a Hydra... cut off one problem just to have two more popping out.
Leader and Coder: Project Epsylon | Drag[en]gine Game Engine

Have you tested to see wht GetLastError returns BEFORE the LoadLibery call?

In the past ive been faced with a Win32 function not setting the value and its an old one left over.

A possiblity is that your DLL(s) is returning the wrong value from DllMain if any. LoadLibery unloads your dll and failes if you are accidently returning a "cant work" number.

In this case it *might* be expecting your DLL to Set the last error.

Now you say you dont have a DllMain so this should not happen.
Your description implies to me its a dll loading dlls. If so do these sub-dlls have DllMain?

Maybe you should try one with a DllMain incased in a #define to prevent problems on other platforms. Ok im struggling now.......:D

This topic is closed to new replies.

Advertisement