Exemplo n.º 1
0
 public static STGMEDIUM GetData(Microsoft.VisualStudio.OLE.Interop.IDataObject pDataObject, ref FORMATETC fmtetc)
 {
     FORMATETC[] af = new FORMATETC[1];
     af[0] = fmtetc;
     STGMEDIUM[] sm = new STGMEDIUM[1];
     pDataObject.GetData(af, sm);
     fmtetc = af[0];
     return(sm[0]);
 }
Exemplo n.º 2
0
        void OleInterop.IDataObject.GetData(OleInterop.FORMATETC[] pformatetcIn, OleInterop.STGMEDIUM[] pRemoteMedium)
        {
            if (null != oleData)
            {
                oleData.GetData(pformatetcIn, pRemoteMedium);
                return;
            }

            // Check that the arrays are not null and with only one element.
            if ((null == pformatetcIn) || (pformatetcIn.Length != 1) ||
                (null == pRemoteMedium) || (pRemoteMedium.Length != 1))
            {
                throw new ArgumentException();
            }

            // Call the method on the BCL interface
            BclComTypes.FORMATETC bclFormat = StructConverter.OleFormatETC2Bcl(ref pformatetcIn[0]);
            BclComTypes.STGMEDIUM bclMedium;
            bclData.GetData(ref bclFormat, out bclMedium);
            pRemoteMedium[0] = StructConverter.BclSTGMEDIUM2Ole(ref bclMedium);
        }
Exemplo n.º 3
0
        public static STGMEDIUM GetData(Microsoft.VisualStudio.OLE.Interop.IDataObject dataObject, ref FORMATETC fmtetc)
        {
            if (dataObject == null)
            {
                throw new ArgumentNullException("dataObject");
            }

            FORMATETC[] af = new FORMATETC[1];
            af[0] = fmtetc;
            STGMEDIUM[] sm = new STGMEDIUM[1];
            dataObject.GetData(af, sm);
            fmtetc = af[0];
            return(sm[0]);
        }