ShowRemapHueDlg Example for C++ 5.0 and later

void CDialog::OnShowRemapHueDlg()
{
	HRESULT hr;
	int nRet;

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

	ILEADRasterDlgClr_U *m_pRasterDlgClr = NULL;
	hr = CoCreateInstance(CLSID_LEADRasterDlgClr_U,
		NULL,
		CLSCTX_ALL,
		IID_ILEADRasterDlgClr_U,
		(LPVOID*)&m_pRasterDlgClr);

	nRet = m_pRasterDlgKrn->InitDlg(INIT_WITH_COLOR);

	m_pRasterDlgClr->UIFlags = REMAPHUE_SHOW_PREVIEW |
		REMAPHUE_SHOW_TOOL_ZOOMLEVEL;

	m_pRasterDlgClr->Bitmap = m_pLead1.GetBitmap();

	nRet = m_pRasterDlgClr->ShowRemapHueDlg((long)m_hWnd);

	if (nRet == 0 && m_pRasterDlgClr->DialogStatus == DLG_OK)
	{
		for (int i=0; i< m_pRasterDlgClr->RemapHueTablesSize; i++)
		{
			m_pLead1.put_MaskTable(i, m_pRasterDlgClr->MaskTable[i]);
			m_pLead1.put_HTable(i, m_pRasterDlgClr->HueTable[i]);
			m_pLead1.put_STable(i, m_pRasterDlgClr->SaturationTable[i]);
			m_pLead1.put_VTable(i, m_pRasterDlgClr->ValueTable[i]);
		}

		m_pLead1.RemapHue(true, true, false, false);
	}
}