65.9K
CodeProject is changing. Read more.
Home

How to create and support Plugins

starIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIconemptyStarIcon

1.55/5 (32 votes)

Mar 5, 2004

viewsIcon

42803

downloadIcon

1824

It demonstrates how to use plugins and how to create them in VC++.

Introduction

This text is meant for those who are thinking of supporting plugins in their applications. Now what is a plugin? I have tried to find some solutions on net and have got a conclusion that these are only dlls which have to support some format. Eg. I have one application to call functions which are not known at compile time. Possible solution is to load function from a Dll using GetProcAddress ( win32 API ). Before that there must be some set of functions which are always sure to be there in dll. I have two. 1) GetFunctionCount() return count of functions 2) GetFunctionNames(LPCTSTR *s_fn_names) copies function names Now These functions are responsible to return enough information to be used for making calls to functions at runtime. Read the rest in code itself. It's easy to understand source code.