Share via

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 development | Windows API - Win32

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.