I have an Application and want to drop a file in it. I used the COleDropTarget class and derived from it. In my CMainFrame class in the methode OnCreate I register it. This return true.
When OnDrop get开发者_如何学运维s called pDataObject->GetFileData(CF_TEXT);
or even pDataObject->IsDataAvailable(CF_TEXT)
returns 0.
Can someone tell me why?
Thanks
Dropping a file doesn't have the data type CF_TEXT but CF_HDROP. You have to check for that and then extract the file paths from the CF_HDROP structure.
To get the paths from the CF_HDROP structure, use the DragQueryFile API.
精彩评论