Click here to Skip to main content
15,893,663 members
Articles / Desktop Programming / MFC

The Ultimate Toolbox FAQ

Rate me:
Please Sign up or sign in to vote.
4.38/5 (4 votes)
5 Oct 2007CPOL7 min read 48K   587   17  
A selection of frequently asked questions submitted by users of the Ultimate Toolbox
// ToolTipInViewView.cpp : implementation of the CToolTipInViewView class
//

#include "stdafx.h"
#include "ToolTipInView.h"

#include "ToolTipInViewDoc.h"
#include "ToolTipInViewView.h"
#include "MainFrm.h"


#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CToolTipInViewView

IMPLEMENT_DYNCREATE(CToolTipInViewView, CEditView)

BEGIN_MESSAGE_MAP(CToolTipInViewView, CEditView)
	//{{AFX_MSG_MAP(CToolTipInViewView)
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CToolTipInViewView construction/destruction

CToolTipInViewView::CToolTipInViewView()
{
	// TODO: add construction code here

}

CToolTipInViewView::~CToolTipInViewView()
{
}

BOOL CToolTipInViewView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CEditView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CToolTipInViewView drawing

void CToolTipInViewView::OnDraw(CDC* pDC)
{
	CToolTipInViewDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CToolTipInViewView diagnostics

#ifdef _DEBUG
void CToolTipInViewView::AssertValid() const
{
	CEditView::AssertValid();
}

void CToolTipInViewView::Dump(CDumpContext& dc) const
{
	CEditView::Dump(dc);
}

CToolTipInViewDoc* CToolTipInViewView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CToolTipInViewDoc)));
	return (CToolTipInViewDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CToolTipInViewView message handlers

int CToolTipInViewView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CEditView::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	CRect rect;
	rect.top=0;
	rect.left=0;
	rect.bottom=100;
	rect.right=100;
	BOOL bRet=((CMainFrame*) AfxGetMainWnd())->m_tip.AddTool(this,_T("TEST"),&rect, 1);
	
	SetWindowText(_T("Move mouse to lefttop 100x100 pixels rectangle to see the tooltip."));
	return 0;
}

BOOL CToolTipInViewView::PreTranslateMessage(MSG* pMsg) 
{
	return CEditView::PreTranslateMessage(pMsg);
}

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)


Written By
Web Developer
Canada Canada
In January 2005, David Cunningham and Chris Maunder created TheUltimateToolbox.com, a new group dedicated to the continued development, support and growth of Dundas Software’s award winning line of MFC, C++ and ActiveX control products.

Ultimate Grid for MFC, Ultimate Toolbox for MFC, and Ultimate TCP/IP have been stalwarts of C++/MFC development for a decade. Thousands of developers have used these products to speed their time to market, improve the quality of their finished products, and enhance the reliability and flexibility of their software.
This is a Organisation

476 members

Comments and Discussions