|
#pragma once
#using <mscorlib.dll>
using namespace System;
using namespace System::Reflection;
using namespace System::Windows::Forms;
class CUserCtrlView : public CView
{
DECLARE_DYNCREATE(CUserCtrlView)
protected:
CUserCtrlView(); // protected constructor used by dynamic creation
virtual ~CUserCtrlView();
CString m_strWinCtrlID;
BOOL m_bDotNetView;
public:
gcroot< Object* > m_pWinFormControl;
class CWFControlWrapper : public CWnd
{
public:
CWFControlWrapper();
virtual ~CWFControlWrapper(void);
IUnknown * pUnkControl ;
IUnknown * GetManagedControl() { return pUnkControl; }
void SetControlSite(COleControlSite * pSite) { m_pCtrlSite = pSite; }
};
virtual void OnDraw(CDC* pDC); // overridden to draw this view
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
virtual BOOL PreTranslateMessage(MSG* pMsg);
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
public:
virtual void OnInitialUpdate();
protected:
afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message);
afx_msg void OnSize(UINT nType, int cx, int cy);
DECLARE_MESSAGE_MAP()
private:
CWFControlWrapper m_Control;
virtual BOOL CreateControlSite( COleControlContainer*, COleControlSite** ppSite, UINT nID, REFCLSID clsid );
public:
IUnknown * GetUnk() { return m_Control.pUnkControl; }
IDispatch* GetDispatch();
};
|
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.
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