Sign in to follow this  
RPTD

LoadLibrary finds 'no more files' ?!

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this