Click here to Skip to main content
15,886,199 members
Articles / Programming Languages / C++

COM from scratch - PART TWO

Rate me:
Please Sign up or sign in to vote.
4.85/5 (44 votes)
17 Apr 200414 min read 226.4K   6K   134  
An article about COM Library.
// Component2Wnd.h: interface for the CComponent2Wnd class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_COMPONENT2WND_H__72A6101F_D93A_4758_938C_DC7FBDD4E790__INCLUDED_)
#define AFX_COMPONENT2WND_H__72A6101F_D93A_4758_938C_DC7FBDD4E790__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ComponentWndMenu.h"


class CComponent2Wnd : public CWnd
{
// Construction
public:   
	IUnknown*    m_pComponent2sIUnknown; // is used in order to point to itself whenever from the menu the user chooses Release function
    CComponentWndMenu m_WndMenu;
public:
	CComponent2Wnd();
   
// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CComponent2Wnd)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CComponent2Wnd();

	// Generated message map functions
protected:
	//{{AFX_MSG(CComponent2Wnd)
	afx_msg void OnMove(int x, int y);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSysMenu);
	afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	//}}AFX_MSG
DECLARE_MESSAGE_MAP()

public:
	void _KillTimer();
	void StartTimer();
	bool m_bStop;
	bool m_bMenuHasOpend;
	long m_cRef;
	COLORREF m_color_hittest;
private:
	UINT m_nItemID;
};

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

//{{AFX_INSERT_LOCATION}}

#endif // !defined(AFX_COMPONENT2WND_H__72A6101F_D93A_4758_938C_DC7FBDD4E790__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
Software Developer
Denmark Denmark
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions