ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 13.1.0 Error found in function PasteFilesFromClipboard

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
foxdingding Posted - Jun 02 2024 : 04:59:28
Error found in function iexWindowsFunctions.PasteFilesFromClipboard

13.1.0
5   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Aug 06 2024 : 01:40:28
Thank you for letting us know.

Nigel
Xequte Software
www.imageen.com
foxdingding Posted - Aug 06 2024 : 01:38:39
This error has been corrected in ImageEn 13.5!
ImageEn 13.5.0 did not report this error!


iexWindowsFunctions.PasteFilesFromClipboard is OK!!
xequte Posted - Jun 03 2024 : 23:48:55
Hi

I cannot see any issues in our method. What version of Delphi are you using? Can you give me some specific steps to reproduce?

Does it only happen with unicode filenames (e.g. filenames that contain Chinese characters)?

There look to be some errors in your code above, so please check it carefully.

Nigel
Xequte Software
www.imageen.com
foxdingding Posted - Jun 03 2024 : 07:44:19




I rewrote this function without reporting the error mentioned above.


class function TMyFun.My_PasteFilesFromClipboard(
  out bMoveFiles: Boolean): TArray<String>;
var
  DropHandle, DropEffect, Effect : HDROP;
  FileCount:Integer;
  Counter:Integer;
  FileName:array [0..MAX_PATH] of char;
const
  DROPEFFECT_NONE   = 0;
  DROPEFFECT_COPY   = 1;
  DROPEFFECT_MOVE   = 2;
  DROPEFFECT_LINK   = 4;
  DROPEFFECT_SCROLL = $80000000;
begin
  Result:=[];
  bMoveFiles:=false;

  OpenClipboard(0);
  Try
      DropEffect := RegisterClipboardFormat('Preferred DropEffect');
      DropHandle := GetClipboardData(CF_HDROP);
      if DropHandle>0 then
      begin
        Effect := GetClipboardData(DropEffect);
        if Effect=0 then Effect := DROPEFFECT_COPY
        else Effect := PDWORD(Effect)^;
        case Effect of
          DROPEFFECT_COPY + DROPEFFECT_LINK:bMoveFiles:=false;
          DROPEFFECT_MOVE                  :bMoveFiles:=TRUE;
        end;

        FileCount:=DragQueryFile(DropHandle,Cardinal(-1),nil,0);
        for Counter := 0 to FileCount-1 do
        begin
          DragQueryFile(DropHandle, Counter, FileName, sizeof(FileName));
          Result:=Result+[FileName];
        end;
      end;
  Finally
      CloseClipboard;
  End;
end;



xequte Posted - Jun 02 2024 : 14:06:27
Hi

What is the error?

Nigel
Xequte Software
www.imageen.com