MTSDKDN.MathTypeSDK.IOleObject oleObject = null; oleDataObject = dataObject as IDataObject; oleObject = dataObject as MTSDKDN.MathTypeSDK.IOleObject; ConnectFORMATETC formatEtc = new ConnectFORMATETC(); ConnectSTGMEDIUM stgMedium = new ConnectSTGMEDIUM(); DataFormats.Format dataFormat; obj.Verb((Excel.XlOLEVerb)3); dataObject = obj.Object; formatEtc.cfFormat =(Int16)DataFormats.GetFormat(DataFormats.MetafilePict ).Id; formatEtc.dwAspect = System.Runtime.InteropServices.ComTypes.DVASPECT.DVASPECT_CONTENT; formatEtc.lindex = -1; formatEtc.ptd = (IntPtr)0; formatEtc.tymed = TYMED.TYMED_MFPICT; stgMedium.unionmember=(IntPtr)0; stgMedium.tymed=TYMED.TYMED_NULL; stgMedium.pUnkForRelease=0; oleDataObject.GetData(ref formatEtc,out stgMedium); //get data returns proper data //what to do now? IntPtr ptr; ptr = stgMedium.unionmember; HandleRef handleRef = new HandleRef(null, ptr); IntPtr ptrToHandle = GlobalLock(handleRef); int Length = GlobalSize(handleRef);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)