• Advertisement

Archived

This topic is now archived and is closed to further replies.

some light on this please

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

can anybody shed some light on how to construct programs to accept plugins, and how are the plugins actually done? prefer some details. Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
Whenever I''ve used plug-ins in my programs, I''ve use renamed dll''s. Create a dll header file that specifies the base interfaces on the plug-in you want. Such as (off the top of my head, so it probably won''t compile):

#ifndef _MYPLUGIN_H_
#define _MYPLUGIN_H_

declspec(dllexport) stdcall int GetVersion(void);
declspec(dllexport) stdcall char ** EnumerateFunctionNames(void);

#endif

Then when you want to use the plug-in call LoadLibrary on the plug-in file name, and check it for the functions in the header. If they aren''t there then it isn''t a valid plug-in. Then you can use the interfaces you specified to access the desired functionality.

Share this post


Link to post
Share on other sites

  • Advertisement