ShowEffectDlg Example for C++ 5.0 and later

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

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

	ILEADRasterDlgEfx_U *m_pRasterDlgEfx = NULL;
	hr = CoCreateInstance(CLSID_LEADRasterDlgEfx_U,
		NULL,
		CLSCTX_ALL,
		IID_ILEADRasterDlgEfx_U,
		(LPVOID*)&m_pRasterDlgEfx);

	nRet = m_pRasterDlgKrn->InitDlg(INIT_WITH_COLOR);

	m_pRasterDlgEfx->Effect->EffectStyle = EFX_EFFECT_BLIND_CLASS; 
	m_pRasterDlgEfx->Effect->Grain = 5; 
	m_pRasterDlgEfx->Effect->Delay = 50; 
	m_pRasterDlgEfx->Effect->MaxPass = 1; 
	m_pRasterDlgEfx->Effect->Transparent = false; 
	m_pRasterDlgEfx->Effect->TransparentColor = RGB(0,0,0); 
	m_pRasterDlgEfx->Effect->WandThickness = 3; 
	m_pRasterDlgEfx->Effect->WandColor = RGB ( 255, 0, 0 ); 
	m_pRasterDlgEfx->UIFlags = EFFECT_SHOW_PREVIEW     |
		EFFECT_DELAY            |
		EFFECT_GRAIN            |
		EFFECT_PASSES           |
		EFFECT_TRANSPARENT      |
		EFFECT_WAND             |
		EFFECT_CLASS_WIPE       |
		EFFECT_CLASS_WIPERECT   |
		EFFECT_CLASS_WIPECIRCLE |
		EFFECT_CLASS_PUSH       |
		EFFECT_CLASS_SLIDE      |
		EFFECT_CLASS_ROLL       |
		EFFECT_CLASS_ROTATE     |
		EFFECT_CLASS_ZOOM       |
		EFFECT_CLASS_DRIP       |
		EFFECT_CLASS_BLIND      |
		EFFECT_CLASS_RANDOM     |
		EFFECT_CLASS_CHECK      |
		EFFECT_CLASS_BLOCKS     |
		EFFECT_CLASS_CIRCLE     |
		EFFECT_CLASS_ELLIPSE; 

	m_pRasterDlgEfx->Bitmap = m_pLead1.GetBitmap();
	nRet = m_pRasterDlgEfx->ShowEffectDlg((long)m_hWnd); 
	if ( nRet == 0 && m_pRasterDlgEfx->DialogStatus == DLG_OK) 
	{
		CString csRes1; 
		CString csRes2; 
		csRes1.Format(TEXT("Effect: %d\nGrain: %d\nDelay: %d\nMaxPass: %d\nTransparent: %d\n"),
			m_pRasterDlgEfx->Effect->EffectStyle, 
			m_pRasterDlgEfx->Effect->Grain, 
			m_pRasterDlgEfx->Effect->Delay, 
			m_pRasterDlgEfx->Effect->MaxPass, 
			m_pRasterDlgEfx->Effect->Transparent); 
		csRes2.Format(TEXT("TransparentColor: %ld\nWandWidth: %d\nWandColor: %ld"),
			m_pRasterDlgEfx->Effect->TransparentColor, 
			m_pRasterDlgEfx->Effect->WandThickness, 
			m_pRasterDlgEfx->Effect->WandColor); 
		AfxMessageBox(csRes1 + csRes2);
	}
}