ShowShearDlg Example for C++ 5.0 and later

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

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

	ILEADRasterDlgImg_U *m_pRasterDlgImg = NULL;
	hr = CoCreateInstance(CLSID_LEADRasterDlgImg_U,
		NULL,
		CLSCTX_ALL,
		IID_ILEADRasterDlgImg_U,
		(LPVOID*)&m_pRasterDlgImg);

	nRet = m_pRasterDlgKrn->InitDlg(INIT_WITH_COLOR);

	m_pRasterDlgImg->EnableHorizontal = true; 
	m_pRasterDlgImg->Angle = 4500; 
	m_pRasterDlgImg->BackColor = RGB(255, 0, 0); 
	m_pRasterDlgImg->UIFlags = SHEAR_AUTOPROCESS |
		SHEAR_SHOW_PREVIEW |
		SHEAR_SHOW_BACKCOLOR |
		SHEAR_SHOW_HORIZONTAL; 

	m_pRasterDlgImg->Bitmap = m_pLead1.GetBitmap();

	m_pRasterDlgImg->ShowShearDlg((long)m_hWnd);

	if (nRet == 0 && m_pRasterDlgImg->DialogStatus == DLG_OK) 
	{
		m_pLead1.Shear(m_pRasterDlgImg->Angle, 
			m_pRasterDlgImg->GetEnableHorizontal(),
			m_pRasterDlgImg->GetBackColor()); 
	}
}