How to serialize a dataObject

  • Thread starter Thread starter Jinlin
  • Start date Start date
J

Jinlin

Does anyone know how to serialize a dataObject. Is it possible?

What I try to do in my application is to allow user drag and drop objects
onto a toolbox type of thing, and try to preserve these objects (DataObject)
when user quit the application, so they could drop they back to an editor
leter.

I can successfully serialize the inner data of dataObject after
GetData(formatType), but by converting to a specific format type, I lose
some useful information. For example, if I try to get "HTML Format" from the
dataObject, it deson't recognize unicode. So I really want to preserve the
dataObject.

Any suggestion will be appreciated.

-Jinlin
 
Jinlin,

You won't be able to do this. The DataObject is not marked as
Serializable, nor does it look like it will give you access to the internal
data. Even if you could get at the internal data, the bytes themselves
might not be representative of everything on the clipboard (it might just be
a pointer to something else, perhaps).

If this is for your application specifically, I would recommend
serializing the objects after they come from the DataObject, not the
DataObject itself.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top