ShowSmoothDlg Example for C++ 5.0 and later

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

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

	ILEADRasterDlgImgDoc_U *m_pRasterDlgImgDoc = NULL;
	hr = CoCreateInstance(CLSID_LEADRasterDlgImgDoc_U, 
		NULL,
		CLSCTX_ALL,
		IID_ILEADRasterDlgImgDoc_U,
		(LPVOID*)&m_pRasterDlgImgDoc);

	nRet = m_pRasterDlgKrn->InitDlg(INIT_WITH_COLOR);

	m_pRasterDlgImgDoc->Smooth->Flags = SMOOTH_ALLFLAGS;
	m_pRasterDlgImgDoc->Smooth->Length = 1;
	m_pRasterDlgImgDoc->WhiteAreaColor = RGB(255, 0, 0); 
	m_pRasterDlgImgDoc->BlackAreaColor = RGB(0, 0, 255); 
	m_pRasterDlgImgDoc->UIFlags = SMOOTH_SHOW_PREVIEW |
		SMOOTH_SHOW_TOOL_ZOOMLEVEL;

	m_pRasterDlgImgDoc->Bitmap = m_pLead1.GetBitmap();

	nRet = m_pRasterDlgImgDoc->ShowSmoothDlg((long)m_hWnd);

	if (nRet == 0 && m_pRasterDlgImgDoc->DialogStatus == DLG_OK) 
	{
		m_pLead1.Smooth(m_pRasterDlgImgDoc->Smooth->Length, 
			m_pRasterDlgImgDoc->Smooth->GetFlags()); 
	}
}