EnableOLEDragMethod Example for C++ 5.0 and later
void COLEDragDlg::OnOLEGiveFeedbackLeadrasterview1()
{
m_RasterView1.SetEnableUseDefaultCursor(FALSE);
}
void COLEDragDlg::OnOLEGiveFeedbackLeadrasterview2()
{
m_RasterView2.SetEnableUseDefaultCursor(FALSE);
}
void COLEDragDlg::OnButton1()
{
ILEADRasterIO * pRasterIO=NULL;
HRESULT hr = CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
if (FAILED(hr))
return;
pRasterIO->Load(m_RasterView2.GetRaster().m_lpDispatch, "d:\\images\\sample1.cmp", 0, 1, 1);
pRasterIO->Release();
m_RasterView1.SetEnableOLEDragMethod(TRUE);
m_RasterView2.SetEnableOLEDragMethod(TRUE);
CPictureHolder PictHolder;
COLEDragApp *pTheApp = (COLEDragApp *)AfxGetApp();
HICON hIcon = pTheApp->LoadStandardIcon(IDI_HAND);
PictHolder.CreateFromIcon(hIcon);
m_RasterView1.SetOLEDragCursor((IDispatch *)PictHolder.m_pPict);
m_RasterView2.SetOLEDragCursor((IDispatch *)PictHolder.m_pPict);
}
void COLEDragDlg::OnButton2()
{
m_RasterView1.SetEnableOLEDragMethod(FALSE);
m_RasterView2.SetEnableOLEDragMethod(FALSE);
}