Jump to content
  • Advertisement
Sign in to follow this  
McZ

can't load .dll file

This topic is 5214 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

well.. I have a wierd problem, I have two plugin dll files, one old and one new.. the problem is that I can't load the new one even though they are the same Dll load code
	HINSTANCE DllHandle;
	typedef void (*PFNSTARTPLUGIN) ( void );

	PFNSTARTPLUGIN StartPlugin;

	DllHandle = LoadLibrary(FileName);

	if( !DllHandle )
	{
		logErrorMessage("Failed to load plugin %s", FileName);
		return false;
	}

	StartPlugin = (PFNSTARTPLUGIN) GetProcAddress(DllHandle, "StartPlugin");

	if( !StartPlugin )
	{
		logErrorMessage("Failed to start plugin %s", FileName);
		return false;
	}

	StartPlugin();

in the plugin.dll files I have this PLUGINDLL_API void StartPlugin(void) { MessageBox(NULL, "Plugin A", "Plugin", MB_OK); } and the same in plugin B, and I have a .def file one for each .dll file they looks like this LIBRARY Plugin EXPORTS StartPlugin @1 I'm using VS.Net 2k3 altough the old plugin that works was once created in VS 6.0 and then converted to VS.Net 2k3 and the new plugin was created in VS.Net 2k3 thats the only difference I can find. but still I can't start the second plugin, It fails on 'StartPlugin'

Share this post


Link to post
Share on other sites
Advertisement
C or C++? If it's C++, don't forget extern "C". As it will be subject to C++ name mangling, and GetProcAddress will need another name to find it :P

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!