Clipboard and Custom Types
I've been trying like crazy to figure out how to copy an object of a custom type to the Clipboard via Clipboard.SetDataObject() and then retrieve it with Clipboard.GetDataObject().
I've tried everything I can think of. I declare a DataObject, made out of my custom object, and give it a format name, and send it to the clipboard. Then I bring it back from the clipboard, as an IDataObject, use GetDataPresent(*format name", true), and it says that the data is present. But when I use GetData, it returns null! What is going on here?
There are many demos about how to use the clipboard with strings and bitmaps but that's pretty useless. What's the point of C#'s clipboard support if all you can do is transfer bitmaps? I can post code if anyone is interested.