Click here to Skip to main content
15,895,709 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 222.9K   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.
// ClAidView.h : interface of the CClAidView class
//


#pragma once


class CClAidView : public CView
{
protected: // create from serialization only
	CClAidView();
	DECLARE_DYNCREATE(CClAidView)

// Attributes
public:
	CClAidDoc* GetDocument() const;

// Operations
public:

// Overrides
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:

// Implementation
public:
	virtual ~CClAidView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
};

#ifndef _DEBUG  // debug version in ClAidView.cpp
inline CClAidDoc* CClAidView::GetDocument() const
   { return reinterpret_cast<CClAidDoc*>(m_pDocument); }
#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 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