ShowContourFilterDlg Example for C++ 5.0 and later

void CDialogs::OnShowContourFilterDlg()
{
	HRESULT hr;
	int nRet;

	ILEADRasterDlgKrn_U *m_pRasterDlgKrn = NULL;
	hr = CoCreateInstance(CLSID_LEADRasterDlgKrn_U,
		NULL,
		CLSCTX_ALL,
		IID_ILEADRasterDlgKrn_U,
		(LPVOID*)&m_pRasterDlgKrn);

	ILEADRasterDlgImgEfx_U *m_pRasterDlgImgEfx = NULL;
	hr = CoCreateInstance(CLSID_LEADRasterDlgImgEfx_U, 
		NULL,
		CLSCTX_ALL,
		IID_ILEADRasterDlgImgEfx_U,
		(LPVOID*)&m_pRasterDlgImgEfx);

	nRet = m_pRasterDlgKrn->InitDlg(INIT_WITH_COLOR);

	m_pRasterDlgImgEfx->MaxError = 5;
	m_pRasterDlgImgEfx->DeltaDirection = 5;
	m_pRasterDlgImgEfx->PutContourOption((ContourFilterOptions)CONTOUR_LINK_COLOR);
	m_pRasterDlgImgEfx->Threshold = 5;
	m_pRasterDlgImgEfx->ContourOptionFlags = CONTOURFILTER_SHOW_OPTION_ALL;

	m_pRasterDlgImgEfx->Bitmap = m_pLead1.GetBitmap();
	m_pRasterDlgImgEfx->UIFlags = CONTOURFILTER_SHOW_PREVIEW |
		CONTOURFILTER_SHOW_DELTADIRECTION |
		CONTOURFILTER_SHOW_MAXIMUMERROR |
		CONTOURFILTER_SHOW_OPTION |
		CONTOURFILTER_SHOW_THRESHOLD |
		CONTOURFILTER_SHOW_TOOL_ZOOMLEVEL; 

	nRet = m_pRasterDlgImgEfx->ShowContourFilterDlg((long)m_hWnd); 

	if (nRet == 0 && m_pRasterDlgImgEfx->DialogStatus == DLG_OK) 
	{
		nRet = m_pLead1.ContourFilter(m_pRasterDlgImgEfx->Threshold, 
			m_pRasterDlgImgEfx->DeltaDirection, 
			m_pRasterDlgImgEfx->MaxError, 
			m_pRasterDlgImgEfx->GetContourOption()); 
	}
}