G
Graham Wideman
Folks:
I am trying to use .NET's DataObject.SetData to set a particular format for
clipboards and drag and drop. But I am as yet unable to prevent .NET
DataObject from prefixing my desired data with some unwanted data.
(I can do the parallel operation just fine using my own implementation of
COM's IDataObject, but trying to do this the .NET way is the problem.)
The actual data content bytes I need to stick into DataObject happen to be a
string (8-bit, not Unicode if it matters). But the ClipboardFormat is not a
standard one like CF_TEXT.
So I use either:
ADataObject.SetData(cfMyFormatName, StringContainingData);
.... or...
ADataObject.SetData(cfMyFormatName, ByteArrayContainingData);
The result is that the data is indeed stuffed into ADataObject, but along
with some additional bytes before and one additional byte after the real
data.
I'm guessing that .NET DataObject is "helpfully" serializing the string or
byte array, rather than just sticking the contents into the DataObject.
How do I get .NET DataObject to just contain that actual bytes I give it,
and not add this extra stuff?
Thanks,
Graham
--
---------------------------------------------------
Graham Wideman
Microsoft Visio MVP
---------------------------------------------------
Book/Tools:
Visio 2002 Developer's Survival Pack
Resources for programmable diagramming at:
http://www.diagramantics.com
(e-mail address removed)
..
I am trying to use .NET's DataObject.SetData to set a particular format for
clipboards and drag and drop. But I am as yet unable to prevent .NET
DataObject from prefixing my desired data with some unwanted data.
(I can do the parallel operation just fine using my own implementation of
COM's IDataObject, but trying to do this the .NET way is the problem.)
The actual data content bytes I need to stick into DataObject happen to be a
string (8-bit, not Unicode if it matters). But the ClipboardFormat is not a
standard one like CF_TEXT.
So I use either:
ADataObject.SetData(cfMyFormatName, StringContainingData);
.... or...
ADataObject.SetData(cfMyFormatName, ByteArrayContainingData);
The result is that the data is indeed stuffed into ADataObject, but along
with some additional bytes before and one additional byte after the real
data.
I'm guessing that .NET DataObject is "helpfully" serializing the string or
byte array, rather than just sticking the contents into the DataObject.
How do I get .NET DataObject to just contain that actual bytes I give it,
and not add this extra stuff?
Thanks,
Graham
--
---------------------------------------------------
Graham Wideman
Microsoft Visio MVP
---------------------------------------------------
Book/Tools:
Visio 2002 Developer's Survival Pack
Resources for programmable diagramming at:
http://www.diagramantics.com
(e-mail address removed)
..