LoadLibrary compatibility?

Started by
6 comments, last by Evil Steve 17 years ago
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
Advertisement
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.
GetLastError is a good tip. I got error code: 126.
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)
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.
Well Ive tried absolut path, relativ and each with null termination and without. No luck so far.
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
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.

This topic is closed to new replies.

Advertisement