Click here to Skip to main content
15,881,819 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 167K   1.9K   207  
A powerful and extensible way of creating plugin-based applications
// ImageParser.h - defines the base class for all image parsers
//
// Part of the Plugin System tutorial
//
///////////////////////////////////////////////////////////////////////////////

#ifndef _IMAGEPARSER_H
#define _IMAGEPARSER_H

// CImageParser is the base class that all image parsers must inherit
class CImageParser
{
public:
	HOSTAPI CImageParser( void ); // adds the parser to the parsers list
	virtual HBITMAP ParseFile( const char *fname )=0; // parses the image file and reads it into a HBITMAP
	virtual bool SupportsType( const char *type ) const=0; // returns true if the file type is supported

protected:
	HOSTAPI HBITMAP CreateBitmap( int width, int height, void **data );
};

#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