Click here to Skip to main content
15,896,486 members
Articles / Programming Languages / C++

Adding automation to MFC applications

Rate me:
Please Sign up or sign in to vote.
4.80/5 (56 votes)
6 Sep 200418 min read 223K   5.6K   134  
Step-by-step instructions on how to add OLE automation to an already existing application. In addition, it illustrates how to do things without using the code as provided by the application wizard.
#if !defined(AFX_SERVOD_H__64832711_32B1_47D0_84DC_B3945920B9D8__INCLUDED_)
#define AFX_SERVOD_H__64832711_32B1_47D0_84DC_B3945920B9D8__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Servod.h : header file
//



/////////////////////////////////////////////////////////////////////////////
// Servod command target

class Servod : public CCmdTarget
{
	DECLARE_DYNCREATE(Servod)

	Servod();           // protected constructor used by dynamic creation

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(Servod)
	public:
	virtual void OnFinalRelease();
	//}}AFX_VIRTUAL

// Implementation
protected:
	virtual ~Servod();

	// Generated message map functions
	//{{AFX_MSG(Servod)
		// NOTE - the ClassWizard will add and remove member functions here.
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
	DECLARE_OLECREATE(Servod)

	// Generated OLE dispatch map functions
	//{{AFX_DISPATCH(Servod)
	afx_msg void Beep();
	//}}AFX_DISPATCH
	DECLARE_DISPATCH_MAP()
	DECLARE_INTERFACE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SERVOD_H__64832711_32B1_47D0_84DC_B3945920B9D8__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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Belgium Belgium
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions