Archived

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

Plugins - how to approach coding them?

This topic is 5602 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 knocked up my own model editor - and to round it off I''d like to add importers using plugins so I can just pop em off as and when. Can anyone point me somewhere that would help? I''ve never used/coded plugins before, and I''m guessing it requires .dll usage - but that''s about it. I need to know how to produce a plugin, and how to get my MFC app to recognise it''s been added to its plugins directory and then load and use it (without having to recompile the app). It should be fairly straightforward... shouldn''t it? :D Oh - one other thing - wouldn''t a Tools forum &/ Article Resource be useful to anyone? I know tools are more or less game/product specific - but a great many techniques for solving problems could be shared (such as plugins )

Share this post


Link to post
Share on other sites
Hi Mak--

You can actually code plugins however you would like. You can make up your own file format and parse the plugins with some sort of scripting language, you can use DLL''s -- and I''m sure there are other ways as well.

Here''s a link to a thread I started a few days ago on how to do this with an object oriented approach. My idea is this. Each plugin will inherit from a very generic base class that will have some pure virtual members. That way, I can load several plugins into a linked list and do something like this on each one:

pluginList->ProcessPlugin(...);

It looks tough at first, especially if you haven''t touched DLL''s before. I''d suggest doing a small DLL project first, maybe even a Windows hook (check MSDN documentation on SetWindowsHookEx). If you need an example badly I can send you a tiny little program I did to disable the Windows key that runs in the SysTray.

Share this post


Link to post
Share on other sites
Okay chaps - thanks for the pointer

Also managed to skulk around the web and found this link http://www.codeproject.com/dll/ which may prove useful for others who tread this path...

Share this post


Link to post
Share on other sites