How to retrieve byte array from clipboard?

  • Thread starter Thread starter Dev10110110
  • Start date Start date
D

Dev10110110

Guest
I have a C# program that copies a simple byte array onto the clipboard. The array comprises a null terminated ASCII text header followed by binary data. Essentially, this is a poor man's IPC implementation.

byte[] DataBytes = new byte [ InstantiatedImage.Length + 10 ];
DataObject ClipboardData = new DataObject();

Encoding.ASCII.GetBytes ( "ByteData:\0" ).CopyTo ( DataBytes, 0 ); // header bytes offset 0 in DataBytes
InstantiatedImage.CopyTo ( DataBytes, 10 ); // data bytes offset 10 in DataBytes
ClipboardData.SetData ( typeof(Byte[]), DataBytes );
Clipboard.SetDataObject ( ClipboardData, true ); //copy DataBytes to clipboard


I need to pull this byte array into a VC/C++ program. Anyone knows how to do this? Thanks.

Continue reading...
 
Back
Top