Some applications (e.g. Thunderbird) may indicate via QueryGetData() that they support a particular drop format, even though a corresponding call to GetData() fails. Therefore, we'll actually attempt to query the data using GetData(). */
| 221 | Therefore, we'll actually attempt to query the data using |
| 222 | GetData(). */ |
| 223 | BOOL DropHandler::CheckDropFormatSupported(IDataObject *pDataObject,FORMATETC *pftc) |
| 224 | { |
| 225 | HRESULT hr; |
| 226 | |
| 227 | /* When using QueryGetData(), the line index |
| 228 | must be -1. This may not be the case when calling |
| 229 | GetData(). */ |
| 230 | LONG lindex = pftc->lindex; |
| 231 | pftc->lindex = -1; |
| 232 | |
| 233 | hr = pDataObject->QueryGetData(pftc); |
| 234 | |
| 235 | pftc->lindex = lindex; |
| 236 | |
| 237 | if(hr != S_OK) |
| 238 | { |
| 239 | return FALSE; |
| 240 | } |
| 241 | |
| 242 | STGMEDIUM stg; |
| 243 | hr = pDataObject->GetData(pftc,&stg); |
| 244 | |
| 245 | if(hr != S_OK) |
| 246 | { |
| 247 | return FALSE; |
| 248 | } |
| 249 | |
| 250 | ReleaseStgMedium(&stg); |
| 251 | |
| 252 | return TRUE; |
| 253 | } |
| 254 | |
| 255 | HRESULT DropHandler::CopyHDropData(IDataObject *pDataObject, |
| 256 | BOOL bPrefferedEffect,DWORD dwEffect) |
nothing calls this directly
no test coverage detected