Recent

Author Topic: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)  (Read 8574 times)

GetMem

  • Hero Member
  • *****
  • Posts: 3464
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2"
« Reply #15 on: November 02, 2017, 08:16:49 am »
I fixed the issue, please test again on 64bit. Thank you.

six1

  • Jr. Member
  • **
  • Posts: 73
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2"
« Reply #16 on: November 02, 2017, 08:28:23 am »
Thanks GetMem!
Edited Download to https://packages.lazarus-ide.org/DragDrop.zip

Best, Michael

minesadorada

  • Hero Member
  • *****
  • Posts: 582
  • Retired
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2"
« Reply #17 on: November 02, 2017, 09:09:37 am »
I fixed the issue, please test again on 64bit. Thank you.
DragDrop V5.2.0.0  Testing environment: as before.
Target=64-bit Windows
Installs from OPM: OK
Compiles: OK
Mixed Demo; Compiles: OK
Mixed Demo; Runs: OK

All Good - congratulations, guys!
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

six1

  • Jr. Member
  • **
  • Posts: 73
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2"
« Reply #18 on: February 08, 2019, 03:20:50 pm »
Changes for Lazarus 2.0 fpc 3.0.4

DropSource.pas Line 886 replace line with
      {$if FPC_FULlVERSION > 30003}
      {$if LCL_FULLVERSION >= 1090000}
        IsDraggingImage := ImageList_BeginDrag(FImages.ResolutionByIndex[0].Reference.Handle, FImageIndex,
      {$else}
        IsDraggingImage := ImageList_BeginDrag(FImages.Handle, FImageIndex,
      {$endif}

DropTarget.pas Line 556 replace with
          {$if FPC_FULlVERSION > 30003}
          {$if LCL_FULLVERSION >= 1090000}
            ImageList_SetDragCursorImage( FImages.ResolutionByIndex[0].Reference.Handle, 0, FImageHotSpot.x, FImageHotSpot.y);
          {$else}
            ImageList_SetDragCursorImage({FImages.Handle} , 0, FImageHotSpot.x, FImageHotSpot.y);
          {$endif}


best, michael
« Last Edit: February 09, 2019, 08:36:10 am by six1 »

GetMem

  • Hero Member
  • *****
  • Posts: 3464
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2"
« Reply #19 on: February 08, 2019, 06:46:30 pm »
Michael,
Are you sure it's FPC_FULLVERSION? The handle change has nothing to do with fpc. More likely LCL_FULLVERSION >= 1090000

six1

  • Jr. Member
  • **
  • Posts: 73
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2"
« Reply #20 on: February 09, 2019, 08:34:26 am »
Hi GetMem,
you're absolutly right!

          {$if LCL_FULLVERSION >= 1090000}

GetMem

  • Hero Member
  • *****
  • Posts: 3464
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2"
« Reply #21 on: February 09, 2019, 08:54:21 am »
Hi GetMem,
you're absolutly right!

          {$if LCL_FULLVERSION >= 1090000}

OK. I updated the package in OPM. Works both with Lazarus 2.0.0 and Trunk.

six1

  • Jr. Member
  • **
  • Posts: 73
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2"
« Reply #22 on: February 09, 2019, 10:22:15 am »
Thank you for your work for the lazarus Comunity!
by the way: I love the OPM

avra

  • Hero Member
  • *****
  • Posts: 1566
    • Additional info
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2"
« Reply #23 on: February 10, 2019, 06:00:41 pm »
There is a compilation error for Lazarus 2.0 fixes with FPC 3.2 fixes:

Quote
Compile package DragDropLazarus 5.2: Exit code 1, Errors: 1, Warnings: 23
DragDrop.inc(220,2) Warning: Illegal identifier "UNSAFE_TYPE" for $WARN directive
DragDrop.inc(221,2) Warning: Illegal identifier "UNSAFE_CODE" for $WARN directive
DragDrop.inc(222,2) Warning: Illegal identifier "UNSAFE_CAST" for $WARN directive
DragDrop.pas(45,15) Warning: An inherited method is hidden by "SetSize(LongInt;LongInt);"
DragDrop.pas(116,14) Warning: An inherited method is hidden by "QueryInterface(constref TGuid;out <Formal type>):LongInt; StdCall;"
DragDrop.pas(139,5) Warning: Constructor should be public
DragDrop.pas(140,5) Warning: Constructor should be public
DragDrop.inc(202,2) Warning: Misplaced global compiler switch, ignored
DragDrop.inc(220,2) Warning: Illegal identifier "UNSAFE_TYPE" for $WARN directive
DragDrop.inc(221,2) Warning: Illegal identifier "UNSAFE_CODE" for $WARN directive
DragDrop.inc(222,2) Warning: Illegal identifier "UNSAFE_CAST" for $WARN directive
DragDropFormats.pas(130,14) Warning: An inherited method is hidden by "Seek(Int64;LongInt;out Int64):LongInt; StdCall;"
DragDropFormats.pas(132,14) Warning: An inherited method is hidden by "Read(Pointer;LongInt;PLongint):LongInt; StdCall;"
DragDropFormats.pas(134,14) Warning: An inherited method is hidden by "CopyTo(IStream;Int64;out Int64;out Int64):LongInt; StdCall;"
DragDrop.inc(202,2) Warning: Misplaced global compiler switch, ignored
DragDrop.inc(220,2) Warning: Illegal identifier "UNSAFE_TYPE" for $WARN directive
DragDrop.inc(221,2) Warning: Illegal identifier "UNSAFE_CODE" for $WARN directive
DragDrop.inc(222,2) Warning: Illegal identifier "UNSAFE_CAST" for $WARN directive
DropSource.pas(98,21) Error: No matching implementation for interface method "SetData(const tagFORMATETC;var TagSTGMEDIUM;LongBool):LongInt; StdCall;" found
DropSource.pas(257,12) Warning: An inherited method is hidden by "GetPerformedDropEffect:DWord;"
DropSource.pas(258,12) Warning: An inherited method is hidden by "GetLogicalPerformedDropEffect:DWord;"
DropSource.pas(259,12) Warning: An inherited method is hidden by "GetPreferredDropEffect:DWord;"
DropSource.pas(260,13) Warning: An inherited method is hidden by "SetPerformedDropEffect(const LongWord);"
DropSource.pas(261,13) Warning: An inherited method is hidden by "SetPreferredDropEffect(const LongWord);"
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

GetMem

  • Hero Member
  • *****
  • Posts: 3464
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2"
« Reply #24 on: February 11, 2019, 08:00:56 am »
There is a compilation error for Lazarus 2.0 fixes with FPC 3.2 fixes.
Fixed. Now it works with FPC 3.2 fixes, FPC Trunk.

avra

  • Hero Member
  • *****
  • Posts: 1566
    • Additional info
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2"
« Reply #25 on: February 11, 2019, 09:12:04 am »
There is a compilation error for Lazarus 2.0 fixes with FPC 3.2 fixes.
Fixed. Now it works with FPC 3.2 fixes, FPC Trunk.
Confirmed. Thanks!  :D
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

six1

  • Jr. Member
  • **
  • Posts: 73
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2"
« Reply #26 on: March 13, 2019, 01:31:20 pm »
Hi GetMem,
you're absolutly right!

          {$if LCL_FULLVERSION >= 1090000}

and also add in uses clause: lclversion  in Files DropTarget.pas and DropSource.pas

Giorgio Tani

  • New member
  • *
  • Posts: 13
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)
« Reply #27 on: April 01, 2019, 01:50:30 pm »
Hello, in first place thank you very much for this excellent port!

I'm testing the SourceDemo example and works fine on Win32, but on Win64 (two W7 64 bit test machines with Lazarus 1.8.4 for Windows 64 bit) the instruction DropFileSource1.Execute generate an access violation error.
Running through the debugger it seems a SIGSEV event - it crashes LCL control.inc, procedure TControl.WndProc, line 2252 Dispatch(TheMessage);

Am I doing something wrong on my side or can you confirm this issue on Win64?

In any case thank you again and keep up the good work!

six1

  • Jr. Member
  • **
  • Posts: 73
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)
« Reply #28 on: April 01, 2019, 02:52:49 pm »
Sorry, but i'm on WIN10 64 bit Lazarus 32bit...
Maybe GetMem can test and solve it...

Giorgio Tani

  • New member
  • *
  • Posts: 13
Re: Fork of Anders Melander's "Drag and Drop Suite 5.2" (WIN only!)
« Reply #29 on: April 14, 2019, 05:23:36 pm »
I've tested dropping files from application to system a bit further, on Windows 64 bit with application compiled with 64 bit Lazarus.
All seems fine until it is called the DoDragDrop function from ole32.dll in unit DropSource.
The very same code works perfectly if compiled for 32 bit, both on Windows 32 bit and Windows 64 bit systems (where it calls the 32 bit version of the dll from SysWOW64).
Probably there is something in IDataObject and IDropSource definition in the library that works fine on 32 bit Windows systems but is not accepted by the 64 bit version of the dll, I'll search further for similar 32-to-64 bit issues in Delphi forums.