aurbach
September 16th, 2005, 07:30 PM
In a C++/WinAPI (non-MFC) context, I am trying to add the ability to drag and drop .txt and .rtf files on a RichEdit control. I can get part way there, but no further.
Here's what I'm already doing...
I call DragAcceptFiles() for the control to enable file-dropping at the window level
I send an EM_SETEVENTMASK to the control with ENM_DROPFILES set to enable file dropping at the RichEdit Level.
I include a case in my WM_NOTIFY handler for the EN_DROPFILES message. In that handler I return a value of 1 if and only if there is exactly one file being dropped and its file extension is either .txt or .rtf. (And this handler is being called and is returning 1 when an appropriate test file is dropped.)
I have a minimal IRichEditOleCallback function which is implementing QueryAcceptData and returning S_OK.
But the text is not appearing. My suspicion is that I need to implement more of the IRichEditOleCallback, but I have no idea which methods need to be implemented.
So my questions are:
Am I on the right track?
Can you offer suggestions or sample code to help?
Thank you for your help.
Here's what I'm already doing...
I call DragAcceptFiles() for the control to enable file-dropping at the window level
I send an EM_SETEVENTMASK to the control with ENM_DROPFILES set to enable file dropping at the RichEdit Level.
I include a case in my WM_NOTIFY handler for the EN_DROPFILES message. In that handler I return a value of 1 if and only if there is exactly one file being dropped and its file extension is either .txt or .rtf. (And this handler is being called and is returning 1 when an appropriate test file is dropped.)
I have a minimal IRichEditOleCallback function which is implementing QueryAcceptData and returning S_OK.
But the text is not appearing. My suspicion is that I need to implement more of the IRichEditOleCallback, but I have no idea which methods need to be implemented.
So my questions are:
Am I on the right track?
Can you offer suggestions or sample code to help?
Thank you for your help.