Click here to Skip to main content
15,893,814 members
Articles / Desktop Programming / Win32

Writing a BHO in Plain C++

Rate me:
Please Sign up or sign in to vote.
4.88/5 (45 votes)
6 Jun 2009CPOL17 min read 211.1K   10.5K   128  
How to write an Internet Explorer plug-in (Browser Helper Object - BHO) using just C++ and the Windows API; no ATL or MFC involved!
/*
 Copyright (C) 2009 Moutaz Haq <cefarix@gmail.com>
 This file is released under the Code Project Open License <http://www.codeproject.com/info/cpol10.aspx>

 This defines our implementation of the IClassFactory interface. The IClassFactory interface is used by COM to create objects of the DLL's main COM class.
*/

#ifndef __CLASSFACTORY_H__
#define __CLASSFACTORY_H__

#include "Unknown.h"

class CClassFactory : public CUnknown<IClassFactory> {
public:
	// Constructor and destructor
	CClassFactory();
	virtual ~CClassFactory();
	// IClassFactory methods
	STDMETHODIMP CreateInstance(IUnknown *pUnkOuter,REFIID riid,void **ppvObject);
	STDMETHODIMP LockServer(BOOL fLock);
private:
	static const IID SupportedIIDs[2];
};

#endif // __CLASSFACTORY_H__

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
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions