Results 1 to 20 of 20

Thread: fafalone: Drag & Drop freeze/hang issue

  1. #1

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,663

    Question fafalone: Drag & Drop freeze/hang issue

    Hi,

    I've been trying to find an issue with my app for a couple of months now and just today I finally found the cause.

    So, I do use the custom Drag & Drop from fafalone: Drag&Drop

    After dropping a File from explorer to the Form, I then open a MODAL form for further options. And this is causing a HANG/FREEZE to Windows. If i drag & drop a file from a folder, then it freezes that folder. If i drag & drop from the Desktop, it freezes the desktop.
    Only when I close the Modal form, messages are going through again.

    And yes, I did try without the drag & drop, the form works fine with no hangs, so definitely the issue is with the IdataObject of the drag & drop class.

    Take a look below of what i mean.. (click to view)



    Any ideas on how to sort this out?
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  2. #2
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,651

    Re: fafalone: Drag & Drop freeze/hang issue

    Would it be possible to attach the project or a simplified demo where this is happening?

  3. #3

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,663

    Re: fafalone: Drag & Drop freeze/hang issue

    Sure, attached is the Original Drag/Drop demo you have, with just an extra form show up when you DROP an image.

    DragDrop.zip
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  4. #4
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,651

    Re: fafalone: Drag & Drop freeze/hang issue

    Can't reproduce it on my system (Windows 10)... Form2 loads, is responsive, as is the source folder. What version of Windows?

  5. #5

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,663

    Re: fafalone: Drag & Drop freeze/hang issue

    Ermm.. that's strange?
    Win10 here too.

    You've seen the attached GIF right ?
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  6. #6
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,253

    Re: fafalone: Drag & Drop freeze/hang issue

    Doesn't faf's code need a typelib? Are you guys using the same tlb version?
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  7. #7
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,651

    Re: fafalone: Drag & Drop freeze/hang issue

    Quote Originally Posted by some1uk03 View Post
    Ermm.. that's strange?
    Win10 here too.

    You've seen the attached GIF right ?
    I see it but when I try dropping I get this:

    Attachment 186705

  8. #8

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,663

    Re: fafalone: Drag & Drop freeze/hang issue

    (Invalid attachment)
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  9. #9
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,651

    Re: fafalone: Drag & Drop freeze/hang issue


  10. #10

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,663

    Re: fafalone: Drag & Drop freeze/hang issue

    Yes, that's correct. You'll see that new MODAL form with the UNLOAD ME option, but try dragging your Windows Folder around? or Clicking on any of the files inside the project folder..
    The Windows Explorer Folder would be locked (i/e not receiving any mouse messages)


    Just like here: https://gifyu.com/image/SmHRq
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  11. #11
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,651

    Re: fafalone: Drag & Drop freeze/hang issue

    It's not locked on my computer. I'll try a few things to see if I can reproduce the issue tomorrow.

  12. #12

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,663

    Re: fafalone: Drag & Drop freeze/hang issue

    I just re-tested on a VM with WIN10 again, and same issue there.

    Drag a PNG from the DESKTOP and then once the 2nd FORM is shown, I can no longer click on any of the icons on the desktop. It becomes locked.
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  13. #13
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,651

    Re: fafalone: Drag & Drop freeze/hang issue

    From folders too or just the desktop in your VM?

    Edit: Wait do you mean while the modal form is up? I thought you meant it froze even after you closed that.

    The form is modal, it's expected behavior... execution stops at Form2.Show vbModal, Me until the form is unloaded. So the drop function never returns until that happens, and the window you drag from is waiting on it.
    Last edited by fafalone; Jan 21st, 2023 at 08:28 AM.

  14. #14
    Member
    Join Date
    Aug 2020
    Posts
    56

    Re: fafalone: Drag & Drop freeze/hang issue

    Quote Originally Posted by some1uk03 View Post
    Can I ask one offtopic question?
    What software did you use to make the gif animation?
    It looks nice.

  15. #15

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,663

    Re: fafalone: Drag & Drop freeze/hang issue

    Quote Originally Posted by fafalone View Post
    From folders too or just the desktop in your VM?

    Edit: Wait do you mean while the modal form is up? I thought you meant it froze even after you closed that.

    The form is modal, it's expected behavior... execution stops at Form2.Show vbModal, Me until the form is unloaded. So the drop function never returns until that happens, and the window you drag from is waiting on it.
    I'm not referring to the APP being frozen because we have a modal form. I'm referring to WINDOWS EXPLORER being frozen after we drag & drop and show a modal form.

    If you initiate the Drag & Drop from a Folder, then the Folder becomes frozen, until we close the modal form.
    If you initiate the drag & drop from desktop, then the Desktop becomes frozen, until we close the modal form.

    The GIF attached shows that whilst we show the modal form, clicking on the Folder we can't move it, we can't gain focus, we can't click on any files etc... Once the form is unloaded, all messages continue to pump through.


    Quote Originally Posted by Zann View Post
    Can I ask one offtopic question?
    What software did you use to make the gif animation?
    It looks nice.
    Camtasia
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  16. #16
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,651

    Re: fafalone: Drag & Drop freeze/hang issue

    Yes this is the expected behavior, because Explorer is waiting on the drop to complete. The drop does not complete until IDropTarget_Drop exits, which it doesn't until Form2.Show vbModal returns and it hits End Sub.

  17. #17

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,663

    Re: fafalone: Drag & Drop freeze/hang issue

    I did some more testing with the standard VB OleDrop and it does seem to behave the same, which I find strange.

    I'm just trying to think ways around it. Rather than re-designing my flow of showing the modal form etc..
    Why can't the clearup code happen before the RaiseEvent Drop is called, rather than on existing the SUB ?
    Can't we somehow flush and release all object before raising the event, that way it's all cleared up and wouldn't cause a freeze ?
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  18. #18
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: fafalone: Drag & Drop freeze/hang issue

    Quote Originally Posted by some1uk03 View Post
    I did some more testing with the standard VB OleDrop and it does seem to behave the same, which I find strange.

    I'm just trying to think ways around it.
    The usual workaround is:
    - to "gobble up all relevant data" from the Data-Object, which you need for further processing immediately
    ..("parking" it in a Variable of your choice)
    - with the goal to exit the OleDrop-Event as fast as possible, but not without starting a little "10msec decoupling timer" as well
    - from within the EventHandler of that "decoupling-one-shot-timer" you can then do anything you want
    ..(disabling the timer itself, followed by showing your modal Form-Popup - because you have your "OleDrop-Data" already buffered in a Variable)

    HTH

    Olaf

  19. #19

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,663

    Re: fafalone: Drag & Drop freeze/hang issue

    Ok, I have now indeed implemented the workaround method with a Timer to launch after a few MS, which solves the issue.



    I have come across another issue though.
    So we have a DroppedEvent, but that only fires if dropped on the TARGET.

    Is there a way to create a new EVENT which acts as a Dropped/MouseUP event, EVEN if the mouse isn't released ABOVE the target ?

    I note that the FORMs MouseUP isn't raised if you release/let go over the mouse on drag.
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  20. #20

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,663

    Re: fafalone: Drag & Drop freeze/hang issue

    I wonder if subclassing is the only option left to detect the MouseUp event.

    Any other ideas anyone?
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width