ShowRotateDlg Example for C++ 5.0 and later

void CDialogs::OnShowRotateDlg()
{
	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->EnableZoomToFit = false; 
	m_pRasterDlgImg->BackColor = RGB(255, 0, 0); 
	m_pRasterDlgImg->Bitmap =  m_pLead1.GetBitmap();
	m_pRasterDlgImg->UIFlags = ROTATE_SHOW_PREVIEW |
		ROTATE_SHOW_BACKCOLOR |
		ROTATE_SHOW_RESIZE; 

	m_pRasterDlgImg->EnableMethodErrors= false; 
	m_pRasterDlgImg->ShowHelpButton= true; 

	nRet = m_pRasterDlgImg->ShowRotateDlg((long)m_hWnd); 
	if (nRet == 0 && m_pRasterDlgImg->DialogStatus== DLG_OK) 
	{
		m_pLead1.Rotate(m_pRasterDlgImg->Angle, 
			m_pRasterDlgImg->GetRotateFlags(),
			m_pRasterDlgImg->GetBackColor()); 
	}
}