

Chelly
-
Content Count
4 -
Joined
-
Last visited
Posts posted by Chelly
-
-
40 minutes ago, Remy Lebeau said:Are you subclassing the RichEdit to receive WM_DROPFILES? Are you registering the RichEdit with DragAcceptFiles() to receive WM_DROPFILES?
Unlike other UI controls, a RichEdit can send an EN_DROPFILES notification to its parent window when you drop files onto the RichEdit. Are you able to receive that notification?
Thank you for your answer.
I have usedDragAcceptFiles()
and set the parent window to receive the notification, but it still can't handle theWM_DROPFILES
message.
Only image files are not accepted.By the way, the same code works correctly in XE6.
-
Hi, I upgraded the builder from XE6 to 12.
How can I catch the WM_DROPFILES message when I drag an image file (like PNG or JPG) and drop it into a TRichEdit? Other types of files are correctly catching the WM_DROPFILES, but image files don't work.
It seems like the image file is automatically converted to RTF text. How can I stop this behavior?
-
Labelmanager2_tlb::IDocument* __fastcall Open(BSTR strDocName/*[in]*/, VARIANT_BOOL ReadOnly/*[in,def,opt]*/) { TDispID dispid(/ Open / DISPID(7)); TAutoArgs<2> _args; _args[1] = strDocName /*[VT_BSTR:0]*/; _args[2] = ReadOnly /*[VT_BOOL:0]*/; OleFunction(_dispid, _args); return (Labelmanager2_tlb::IDocument* /*[C1]*/)(LPDISPATCH) /*[VT_DISPATCH:1]*/_args.GetRetVariant(); }
Its looks like the opterator= doesnt work.
I tried step execution ,than i found
_args[1] = strDocName /*[VT_BSTR:0]*/;
this line is entering into the bool opertartor as follow
OleVariant& operator =(const bool rhs) { PVariant(this)->operator=(rhs); return *this; }
so ,maybe we can as follow
Labelmanager2_tlb::IDocument* __fastcall Open(BSTR strDocName/*[in]*/, VARIANT_BOOL ReadOnly/*[in,def,opt]*/) { TDispID dispid(/ Open / DISPID(7)); TAutoArgs<2> _args; UnicodeString strChange = strDocName; _args[1] = strChange /*[VT_BSTR:0]*/; _args[2] = ReadOnly /*[VT_BOOL:0]*/; OleFunction(_dispid, _args); return (Labelmanager2_tlb::IDocument* /*[C1]*/)(LPDISPATCH) /*[VT_DISPATCH:1]*/_args.GetRetVariant(); }
Catch WM_DROPFILES in TRichEdit
in VCL
Posted
Yes, the version of RichEdit in 12 is 4.1, starting from 11. However, I couldn't find any update logs about image drag-and-drop behavior on the Microsoft website.