Re: Drag and Drop Outlook Contact
by UmFuZHkgUm9nZXJz » Sun, 30 Apr 2006 05:51:01 GMT
i Dmitry
Here is what I did to get this to work. When calling GetData I request
TYMED_ISTREAM | TYMED_ISTORAGE and GetData responds with a *IStorage pointer.
I then use StgCreateStorageEx to create a local store and then ise
IStorage.CopyTo to save it to the local hard drive. Thanks for all of your
assistance.
Here is my Clarion code for those interested:
fmtetc.cfFormat = SELF.m_cfFileContents
fmtetc.ptd = 0
fmtetc.dwAspect = DVASPECT_CONTENT
fmtetc.lindex = -1
fmtetc.tymed = BOR(TYMED_ISTREAM,TYMED_ISTORAGE)
IF pDataObject.QueryGetData(ADDRESS(fmtetc)) = S_OK
bDropHandled = TRUE
pNewString &= NEW(STRING(SIZE(STGMEDIUM)))
stgmed &= ADDRESS(pNewString)
IF ~stgmed &= NULL
kcr_memset(ADDRESS(stgmed),0,SIZE(STGMEDIUM))
fmtetc.lindex = 0
hr = pDataObject.GetData(ADDRESS(fmtetc), ADDRESS(stgmed))
IF hr = S_OK
CASE stgmed.tymed
OF TYMED_ISTORAGE
thisStorage &= (stgmed.u.pstg)
cdFilename = 'c:\sample.msg'
IF wcdFilename.Init(cdFilename)
hr = StgCreateStorageEx(wcdFilename.GetWideStr(), |
BOR(BOR(BOR(STGM_DIRECT,STGM_CREATE),STGM_READWRITE),STGM_SHARE_EXCLUSIVE), |
STGFMT_STORAGE,0,0,0,ADDRESS(_ISTORAGE),pObjectOpen)
IF hr = S_OK
myStorage &= (pObjectOpen)
hr = thisStorage.CopyTo(0,0,0,myStorage)
myStorage.Release()
END
END
--
Regards,
Randy
"Dmitry Streblechenko" wrote: