Reporting drag failure to windows

In juce’s windows-specific code to handle drag-and-drop, there’s a call to IDataObject::GetData in JuceDropTarget::updateFileList. Only if GetData succeeds does updateFileList do anything, but I think that return value needs to bubble up to the callers of updateFileList and make its way back to the OS.

From the Notes to Implementers section of[quote]If the data object cannot comply with the information specified in the FORMATETC, the method should return DV_E_FORMATETC. If an attempt to allocate the medium fails, the method should return STG_E_MEDIUMFULL.[/quote]
Something like this at the beginning of DragEnter and Drop is what I’m talking about:

HRESULT hr = updateFileList (pDataObject); if (hr != S_OK) return hr; Without this change, I may get my filesDropped method called with 0 files. With this change the OS displays a do not enter symbol and doesn’t let the user drop data that IDataObject::GetData can’t handle. In my specific test, IDataObject::GetData returns DV_E_FORMATETC.

Thanks! I’ve made this change if you want to take a look and sanity-check what I’ve done…

I don’t see it here:;a=blob_plain;f=src/native/windows/juce_win32_Windowing.cpp;hb=HEAD. Am I looking in the right place?

All my latest stuff is on the modules branch.

Looks good.