I’m working on a plugin that requires the ability to drag and drop wav/midi files directly into the host application. I am overriding the “MouseDrag()” function and using “performExternalDragDropOfFiles()” to move a list of selected files to the host. Although it appears to work well in almost every DAW, there are a few that cause issues when I attempt to drag after saving and reopening that session.
In Studio One 4, I will start a new session, load my plugin, and drag files successfully, then I will save that session, close all songs, reopen the saved session, and when I attempt to drag it creates a dmp file and pops up a message that an unexpected error has occurred. Upon inspecting the dmp file, the exception says “The thread tried to read from or write to a virtual address for which it does not have the appropriate access.”. When I traced the error in my code I found that it came down to the line:
bool dragWasSuccessful = dragContainer->performExternalDragDropOfFiles(str, false);
What am I doing wrong? Or have I just stumbled onto a bug in JUCE? If there is any example code that someone could provide or any suggestions of how this can be improved I would greatly appreciate that! The function seems to work with many DAWs but has crashed in both Studio One 4 and Ableton. Thanks in advance!