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

Understanding COM Event Handling

, 9 Dec 2004
Learn the fundamental principles of COM Event Handling via a C++ template class that allows for generic handling of dispinterface COM events.
teventhandler_src.zip
TEventHandler
EventFiringObject
TestClient
EventFiringObject.def
EventFiringObject.dsp
EventFiringObject.dsw
EventFiringObject.rgs
EventFiringObject.tlb
EventFiringObjectps.def
EventFiringObjectps.mk
EventFiringObject.tlh
EventFiringObject.tli
res
TestClient.clw
TestClient.dsp
TestClient.dsw
TestClient.ico
// stdafx.h : include file for standard system include files,
//  or project specific include files that are used frequently, but
//      are changed infrequently
//

#if !defined(AFX_STDAFX_H__3CB2ACFB_975A_4683_8CCF_CE930C295BF0__INCLUDED_)
#define AFX_STDAFX_H__3CB2ACFB_975A_4683_8CCF_CE930C295BF0__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers

#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions
#include <afxdisp.h>        // MFC Automation classes
#include <afxdtctl.h>		// MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>			// MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT


//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#pragma warning(disable : 4786)

// ***** import the COM object's type library as usual. *****
#import "..\EventFiringObject\Debug\EventFiringObject.dll"
using namespace EVENTFIRINGOBJECTLib;

// ***** include our TEventHandler.h header class and use the TEventHandlerNamespace namespace. *****
#include "TEventHandler.h"
using namespace TEventHandlerNamespace;

#endif // !defined(AFX_STDAFX_H__3CB2ACFB_975A_4683_8CCF_CE930C295BF0__INCLUDED_)

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

Lim Bio Liong
Web Developer
Singapore Singapore
Lim Bio Liong is a Specialist at a leading Software House in Singapore.
 
Bio has been in software development for over 10 years. He specialises in C/C++ programming and Windows software development.
 
Bio has also done device-driver development and enjoys low-level programming. Bio has recently picked up C# programming and has been researching in this area.

| Advertise | Privacy | Mobile
Web01 | 2.8.140821.2 | Last Updated 10 Dec 2004
Article Copyright 2004 by Lim Bio Liong
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid