Click here to Skip to main content
15,886,025 members
Articles / Programming Languages / C++

Plugin System – an alternative to GetProcAddress and interfaces

Rate me:
Please Sign up or sign in to vote.
4.85/5 (64 votes)
25 May 2007CPOL10 min read 167.4K   1.9K   207  
A powerful and extensible way of creating plugin-based applications
// Host.h - defines the host API
//
// Part of the Plugin System tutorial
//
///////////////////////////////////////////////////////////////////////////////

#ifndef _HOST_H
#define _HOST_H

#ifdef COMPILE_HOST
#define HOSTAPI __declspec(dllexport) // when the host is compiling
#else
#define HOSTAPI __declspec(dllimport) // when the plugins are compiling
#endif

// adds the parser to the g_Parsers list
void AddParser( class CImageParser *parser );

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
Ivo started programming in 1985 on an Apple ][ clone. He graduated from Sofia University, Bulgaria with a MSCS degree. Ivo has been working as a professional programmer for over 12 years, and as a professional game programmer for over 10. He is currently employed in Pandemic Studios, a video game company in Los Angeles, California.

Comments and Discussions