http://forums.wxwidgets.org/viewtopic.p ... highlight=
I've tried to simplify my problem using a wxString to drag&drop with a wxDataObject but again without success

this is the code:
Code: Select all
ReactionDnDObject::ReactionDnDObject(void* buf, size_t len)
{
this->m_Reaction = new wxString( (*(wxString*)buf) );
this->m_ObjLen = sizeof(*this->m_Reaction);
wxLogDebug(wxT("Constructor buf: %s"),*m_Reaction);
}
bool ReactionDnDObject::SetData( const wxDataFormat& format, size_t len, const void *buf )
{
wxLogDebug(wxT("Set Data buf: %s"),*((wxString*)buf)); // here i can't access buf
if (this->m_Reaction)
delete this->m_Reaction;
m_Reaction = new wxString( (*(wxString*)buf) );
this->m_ObjLen = len;
}
bool ReactionDnDObject::GetDataHere(const wxDataFormat& format, void *buf )const
{
buf = (void*)(new wxString(*this->m_Reaction));
wxLogDebug(wxT("GetDataHere buf:%s"),*((wxString*)buf));
return true;
}
size_t ReactionDnDObject::GetDataSize(const wxDataFormat& format )const
{
return m_ObjLen;
};
thx