virtual void process_dropped_files_async(interface IDataObject * p_dataobject,t_uint32 p_op_flags,HWND p_parentwnd,process_locations_notify_ptr p_notify) = 0;
playlist_incoming_item_filter_v2::process_dropped_files_async() manage for you the async creation of metadb handles contained in the IDataObject structure, and on completion will call
p_notify->on_completion() (in the main thread).
example:
class dropped_items_process_locations_notify : public process_locations_notify {
public:
dropped_items_process_locations_notify(controller_window::context_menu_action_t action) : m_action(action) { }
void on_completion(const pfc::list_base_const_t<metadb_handle_ptr> & p_items) {
// do something here
}
void on_aborted() { }
private:
controller_window::context_menu_action_t m_action;
};
HRESULT __stdcall controller_window::Drop(IDataObject * pDataObject, DWORD grfKeyState, POINTL pt, DWORD * pdwEffect) {
...
service_ptr_t<process_locations_notify> completion = new service_impl_t<dropped_items_process_locations_notify>(action);
t_uint32 flags = playlist_incoming_item_filter_v2::op_flag_background|playlist_incoming_item_filter_v2::op_flag_delay_ui;
static_api_ptr_t<playlist_incoming_item_filter_v2>()->process_dropped_files_async(pDataObject, flags, *this, completion);
...
return S_OK;
}