Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Plugin System – an alternative to GetProcAddress and interfaces

, 25 May 2007 CPOL
A powerful and extensible way of creating plugin-based applications
pluginsystem_src.zip
defmaker.exe
readme.rtf
TestImage1.bmp
TestImage2.tga
defmaker
defmaker.dsp
defmaker.dsw
DLL+EXE
Host.dsw
HostExe.dsp
BMPParser
BMPParser.dsp
Host
Host.dsp
Release
BMPParser.imp
Host.dll
HostExe.exe
TGAParser.imp
TGAParser
TGAParser.dsp
EXE
Host.dsp
Host.dsw
BMPParser
BMPParser.dsp
ImageParser
ImageParser.dsp
Release
BMPParser.imp
Host.exe
TGAParser.imp
TGAParser
TGAParser.dsp
Interface
Host.dsp
Host.dsw
BMPParser
BMPParser.dsp
Release
BMPParser.imp
Host.exe
TGAParser.imp
TGAParser
TGAParser.dsp
// 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)

Share

About the Author

Ivo Beltchev
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.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.141223.1 | Last Updated 25 May 2007
Article Copyright 2007 by Ivo Beltchev
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid