some light on this please
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!
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.
#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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement