Serialize IDataObject into FileMapping, c++

Igor Lapichev 1 Reputation point
2021-04-23T07:48:12.077+00:00

Hi all!

I'm trying to implement my own drag-n-drop mechanism.
So, I need to serialize IDataObject in one process and send this byte array into another process using FileMapping.
Right now I'm looping around foarmatect structure and saving STGMEDIUM data using MapViewOfFile.

TYMED_HGLOBAL- No problems with this.
TYMED_GDI - as far as I see, I need to serialize DIBSECTION structure manually, is not it? Or probably there is some api function for this?
TYMED_ENHMF - Should I use GetEnhMetaFileBits?
TYMED_MFPICT - Something like GetEnhMetaFileBits?
TYMED_ISTREAM, TYMED_ISTORAGE - Have now idea for now

Or maybe there is some chip (easy) way to serialize object in few lines?

Thanks on advise.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
1,903 questions
{count} votes