• Advertisement
Sign in to follow this  

LoadLibrary finds 'no more files' ?!

This topic is 4841 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
nobody has an idea? i'm kinda cut off unless i can solve this issue.

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
Sign in to follow this  

  • Advertisement