- wxBitmapDataObject* bitmapDataObject = (wxBitmapDataObject *)data;
- wxBitmap* bitmap = (wxBitmap *)wxGetClipboardData(data->GetFormat());
+ wxBitmapDataObject& bitmapDataObject = (wxBitmapDataObject &)data;
+ wxBitmap* bitmap = (wxBitmap *)wxGetClipboardData(data->GetPreferredFormat());