Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C++ class question Pin
Daniel Pfeffer9-Dec-20 1:19
professionalDaniel Pfeffer9-Dec-20 1:19 
AnswerRe: C++ class question Pin
Richard MacCutchan9-Dec-20 3:43
mveRichard MacCutchan9-Dec-20 3:43 
GeneralRe: C++ class question Pin
pkfox9-Dec-20 4:53
professionalpkfox9-Dec-20 4:53 
GeneralRe: C++ class question Pin
Richard MacCutchan9-Dec-20 5:42
mveRichard MacCutchan9-Dec-20 5:42 
GeneralRe: C++ class question Pin
pkfox9-Dec-20 6:05
professionalpkfox9-Dec-20 6:05 
GeneralRe: C++ class question Pin
Richard MacCutchan9-Dec-20 6:10
mveRichard MacCutchan9-Dec-20 6:10 
GeneralRe: C++ class question Pin
pkfox9-Dec-20 11:02
professionalpkfox9-Dec-20 11:02 
QuestionDROPEFFECT_NONE does not work in conjunction with CF_HDROP Pin
Member 119022653-Dec-20 7:42
Member 119022653-Dec-20 7:42 
All,

I have a similar code segment as below, and the problem is that when I drag a file from file explorer, the drag over and the drag enter do not allow me to use the DROPEFFECT_NONE. It is overwritten with a DROPEFFECT of DROPEFFECT_COPY.

BOOL CtestdragDlg::OnInitDialog()
{
CDialog::OnInitDialog();

::OleInitialize(NULL);
BOOL bRes = m_Target.Register(&m_List);

m_cfFormat = RegisterClipboardFormat(_T("{2FCA1C31-D8F1-4f20-8051-B0CCF7B6FD0D}"));

m_List.InsertColumn(0,_T("First"),0,300);
m_List.InsertItem(0,_T("Hello"));

return TRUE; // return TRUE unless you set the focus to a control
}


HGLOBAL CtestdragDlg::GetData()
{
char Text[5] = "HHHH";
HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE,strlen(Text)+1);
char *pChar = (char *)GlobalLock(hGlobal);
strcpy(pChar,Text);
GlobalUnlock(hGlobal);
return hGlobal;
}

void CtestdragDlg::OnLvnBegindragList1(NMHDR *pNMHDR, LRESULT *pResult)
{
COleDataSource DataSource;
HGLOBAL hData = GetData();
if (hData)
{
//DataSource.CacheGlobalData(m_cfFormat,hData);
DataSource.CacheGlobalData(CF_HDROP,hData);

DROPEFFECT DropEffect = DataSource.DoDragDrop();
}
*pResult = 0;
}

DROPEFFECT CMyTarget::OnDragOver(CWnd* pWnd,COleDataObject* pDataObject,DWORD dwKeyState,CPoint point)
{
return DROPEFFECT_NONE;
}


When the DROPEFFECT_NONE is returned in the OnDragOver event, I get the effect as if it were in DROPEFFECT_COPY. The COLEDragTarget seems to get the correct value back, but then in goes into OLE32 code that I can figure out.
QuestionRe: DROPEFFECT_NONE does not work in conjunction with CF_HDROP Pin
David Crow4-Dec-20 7:04
David Crow4-Dec-20 7:04 
AnswerRe: DROPEFFECT_NONE does not work in conjunction with CF_HDROP Pin
Member 119022656-Dec-20 12:48
Member 119022656-Dec-20 12:48 
QuestionNetserverenum function return false detail Pin
Member 141178532-Dec-20 23:43
Member 141178532-Dec-20 23:43 
AnswerRe: Netserverenum function return false detail Pin
Richard MacCutchan3-Dec-20 0:06
mveRichard MacCutchan3-Dec-20 0:06 
GeneralRe: Netserverenum function return false detail Pin
Member 141178533-Dec-20 20:38
Member 141178533-Dec-20 20:38 
GeneralRe: Netserverenum function return false detail Pin
Victor Nijegorodov3-Dec-20 20:42
Victor Nijegorodov3-Dec-20 20:42 
GeneralRe: Netserverenum function return false detail Pin
Member 141178533-Dec-20 21:42
Member 141178533-Dec-20 21:42 
GeneralRe: Netserverenum function return false detail Pin
Richard MacCutchan3-Dec-20 22:48
mveRichard MacCutchan3-Dec-20 22:48 
AnswerRe: Netserverenum function return false detail Pin
Randor 3-Dec-20 22:35
professional Randor 3-Dec-20 22:35 
GeneralRe: Netserverenum function return false detail Pin
Member 141178537-Dec-20 3:26
Member 141178537-Dec-20 3:26 
GeneralRe: Netserverenum function return false detail Pin
Randor 7-Dec-20 7:04
professional Randor 7-Dec-20 7:04 
GeneralRe: Netserverenum function return false detail Pin
Member 141178538-Dec-20 2:25
Member 141178538-Dec-20 2:25 
QuestionWhy can't I print my watermark in chrome and edge? Pin
Member 148726812-Dec-20 20:28
Member 148726812-Dec-20 20:28 
AnswerRe: Why can't I print my watermark in chrome and edge? Pin
Richard MacCutchan2-Dec-20 23:05
mveRichard MacCutchan2-Dec-20 23:05 
AnswerRe: Why can't I print my watermark in chrome and edge? Pin
Randor 3-Dec-20 8:29
professional Randor 3-Dec-20 8:29 
Questionto bool or not to bool? Pin
Member 1498043325-Nov-20 8:36
Member 1498043325-Nov-20 8:36 
AnswerRe: to bool or not to bool? Pin
Mircea Neacsu25-Nov-20 9:10
Mircea Neacsu25-Nov-20 9:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.