Jump to content

Chelly

Members
  • Content Count

    4
  • Joined

  • Last visited

Posts posted by Chelly


  1. 12 hours ago, PeterBelow said:

    XE6 and D12 use different versions of the Windows richedit control as far as I remember, that may explain the change in behaviour you see.

    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.


  2. 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 used DragAcceptFiles() and set the parent window to receive the notification, but it still can't handle the WM_DROPFILES message.
    Only image files are not accepted.

    By the way, the same code works correctly in XE6.
     


  3. 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?


  4. 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();
      }
×