The specified record cannot be displayed.
Note the strangeness of the word "record." This is a COM-oriented word for "struct". What you are trying to do almost works, but not quite. The DoDragDrop () method correctly arranges the Point structure on a COM object, possibly because Point has the [ComVisible (true)] attribute. The missing component is the information required by IRecordInfo, a COM interface that describes the layout of the structure. Required because structures have a very compiler-specific layout.
This interface is usually implemented by reading the structure definition from the type library. In fact, it is available, the Point structure is described in c: \ windows \ microsoft.net \ framework \ v2.0.50727 \ system.drawing.tlb. You can look at it using the OleView.exe tool, File + View Typelib.
Everything is fine, except for the part where the recipient of the COM object must translate it back to the managed object, Point. This requires finding out which type library contains the object definition, so IRecordInfo can do its job. What is written to the registry, HKCR \ Record. Which does not contain an entry for Point. Kaboom.
Create your own class (not struct) for storing data, give it the [Serializable] attribute so that it can be trivially marshaled.
source share