开发者

drag and drop problem

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜