Jump to content
  • Advertisement
Sign in to follow this  
Running_Wolf

DLL loading problem

This topic is 5406 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 learned a little about how to load DLLs without using the linker library but now I've run into a problem. My engine is split into modules. I can load the Audio module with no problems whatsoever. But the Input module refuses to recognize the existence of my input functions. They always return NULL. What could be causing this? And how do I solve it? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
without seeing any code, but remembering my early DLL days (hehe that should be 2 weeks ago :P) a problem could be that you're forgetting extern C { /*functions go here*/ }

Share this post


Link to post
Share on other sites
Here's the function definition:
extern "C" __declspec(dllexport) bool GetInputInterface(PrismInputInterface **pInterface);

typedef bool (*GETINPUTINTERFACE)(PrismInputInterface **pInterface);

And here is the code that is supposed to get the function.
pInterface = (GETINPUTINTERFACE)::GetProcAddress(Controls, "GetInputInterface");

As I said before, the same code works for the audio module. Just not for the input module. Thanks in advance.

Share this post


Link to post
Share on other sites
Cannot create a file when that file already exists.

That is what MSDN has to say about the 183 error code I received from GetLastError(). What does that have to do with accessing a DLL exported function?

Share this post


Link to post
Share on other sites
Yes. The audio loads and plays wav files beautifully. And to be more technical it does load the input.dll. No error there. Just when I try to retrieve GetInputInterface does it not work.

Share this post


Link to post
Share on other sites
Quote:
Original post by Running_Wolf
typedef bool (*GETINPUTINTERFACE)(PrismInputInterface **pInterface);

And here is the code that is supposed to get the function.
pInterface = (GETINPUTINTERFACE)::GetProcAddress(Controls, "GetInputInterface");



What is the value of Controls? Could be the source of your problem.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!