Click here to Skip to main content
15,892,768 members
Articles / Web Development / HTML

A Comprehensive CE Class Library to Replace ATL and MFC

Rate me:
Please Sign up or sign in to vote.
4.48/5 (14 votes)
4 Oct 2000CPOL 281.3K   998   70  
A collection of classes for CE that do not use ATL or MFC, plus an FTP client, database viewer, and sample application that solves beam deflection equations.
#include "stdafx.h"
#include "DispDlg.h"

#include "resource.h"

BOOL CeDisplayDlg::OnInitDialog()
{
	CeDialog::OnInitDialog();

	HWND hwnd = GetDlgItem(IDC_COMBO1);
	m_combo.Attach( hwnd );

	return TRUE;
}


void CeDisplayDlg::OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct )
{
	m_combo.MeasureItem(lpMeasureItemStruct);
}


void CeDisplayDlg::OnDrawItem( int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct )
{
	m_combo.DrawItem(lpDrawItemStruct);
}


LRESULT CeDisplayDlg::OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled)
{
	switch (uMsg)
	{
	case WM_MEASUREITEM:
		{
			UINT idCtl = (UINT) wParam;					              // control identifier 
			LPMEASUREITEMSTRUCT lpmis = (LPMEASUREITEMSTRUCT) lParam; // item-size information
			_ASSERTE(IDC_COMBO1 == idCtl);

			OnMeasureItem(idCtl, lpmis);
			bHandled = true;
		}
		break;

	case WM_DRAWITEM:
		{
			UINT idCtl = (UINT) wParam;							// control identifier 
			LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT) lParam; // item-drawing information 
			_ASSERTE(IDC_COMBO1 == idCtl);

			OnDrawItem(idCtl, lpdis);
			bHandled = true;
		}
		break;
	}

	return 0;
}

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
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions