Skip to main content
gamedev.net
🔒 Locked

LoadLibrary compatibility?

Started by CProgrammer Mar 26, 2007 at 9:37 AM 6 replies 900+ views
Original Post
CProgrammer
CProgrammer
Im having some problems with windows LoadLibraryEx which dynamically loads a dll into the app. I have a console dll and i am loading it from a win32 dll. Could that cause a problem? Or could it be because the dll i am loading is using CUDA (nvidias GPU programming tool). I have no idea why it doesnt work but LoadLibraryEx keeps returning NULL pointers. If I load in another dll all is fine. Thanks in advance. -CProgrammer
smitty1276
smitty1276
At the risk of stating the obvious, make sure that the file is actually at the path you are passing in (or in the path if you aren giving a full path).

You could also call GetLastError() to see what error code, if any, is being set.
CProgrammer
CProgrammer
GetLastError is a good tip. I got error code: 126.
Evil Steve
Evil Steve
And what does that give you when you spit it into the error lookup tool? (I don't have the error lookup tool installed here)
CProgrammer
CProgrammer
hmm seems that is the code for module not found. But the module is there and the path correct. Very strange Ill get to the bottom of this. Thanks again for the tip.
CProgrammer
CProgrammer
Well Ive tried absolut path, relativ and each with null termination and without. No luck so far.
CProgrammer
CProgrammer
Hey guys.

Silly me. I solved the problem. Seems Cuda needed some external dependencys and windows wouldnt give me a dll not found error message. Adding these dlls to the folder made it worked. Strange that the error code would tell me that the module isnt found.

Thanks again guys.

-CProgrammer
Evil Steve
Evil Steve
Quote:
Original post by CProgrammer
Hey guys.

Silly me. I solved the problem. Seems Cuda needed some external dependencys and windows wouldnt give me a dll not found error message. Adding these dlls to the folder made it worked. Strange that the error code would tell me that the module isnt found.

Thanks again guys.

-CProgrammer
Ah, yeah - the "module not found" message refers to the additional DLL that Cuda couldn't find.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.