ShowLineRemoveDlg Example for C++ 5.0 and later

void CDialogs::OnShowLineRemoveDlg()
{
	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->LineRemove->GapLength = 3; 
	m_pRasterDlgImgDoc->LineRemove->MaxLineWidth = 9; 
	m_pRasterDlgImgDoc->LineRemove->MaxWallPercent = 10; 
	m_pRasterDlgImgDoc->LineRemove->MinLineLength = 400; 
	m_pRasterDlgImgDoc->LineRemove->Variance = 3; 
	m_pRasterDlgImgDoc->LineRemove->Wall = 15; 
	m_pRasterDlgImgDoc->LineRemove->Flags = LINE_USE_DPI | LINE_USE_VARIANCE; 
	m_pRasterDlgImgDoc->LineRemove->PutRemoveFlags((LineRemoveConstants)LINEREMOVE_VERTICAL); 

	m_pRasterDlgImgDoc->PutModificationColor(RGB ( 0, 255, 0 )); 

	m_pRasterDlgImgDoc->UIFlags = LINEREMOVE_SHOW_PREVIEW |
		LINEREMOVE_SHOW_TOOL_ZOOMLEVEL; 

	m_pRasterDlgImgDoc->Bitmap = m_pLead1.GetBitmap();

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

	if (nRet == 0 && m_pRasterDlgImgDoc->DialogStatus == DLG_OK) 
	{
		m_pLead1.LineRemove(0, 
			m_pRasterDlgImgDoc->LineRemove->MinLineLength, 
			m_pRasterDlgImgDoc->LineRemove->MaxLineWidth, 
			m_pRasterDlgImgDoc->LineRemove->Wall, 
			m_pRasterDlgImgDoc->LineRemove->MaxWallPercent, 
			m_pRasterDlgImgDoc->LineRemove->GapLength, 
			m_pRasterDlgImgDoc->LineRemove->Variance, 
			m_pRasterDlgImgDoc->LineRemove->GetRemoveFlags()
			); 
	}
}