I have a treeview and DHtmlEdit control on a form. I want to provide drag&drop from TV to DHTML. However in OleStartDrag I need to set both the data and format. It looks like:
lparameters data, allowedeffects
text to m.lcHTMLFragment noshow
<b>some html</b>
endtext
lcHTML = thisform.PrepareHtml(m.lcHTMLFragment)
data.SetData( m.lcHTML, "HTML Format" )
This errors out (I don't remember the exact error message a different one with different trials).
If I do the same with a native VFP object.OleStartDrag (say textbox.OleStartDrag) it works just as I want and HTML is pasted to DHTML.
If I don't use Setdata() to change format to "HTML Format" (CF_HTML). Then DHTML gets the full HTML with tags in it (it doesn't render). ie:
< b >this is bold< /b >
vs:
this is boldAs a workaround, instead I am using RegisterClipboardFormat,OpenClipboard ... SetClipboardData etc winAPI. Another approach I use is to directly change the document HTML via its DOM.
With both of these approaches I somewhat have what I want but would like to set dataobject instead.
TV doesn't have an OleStartDrag event in its documentation and I initially thought it should be coming from VFP. However the dataobject (data) doesn't look like to the VFP's DataObject. ie: It doesn't have a SetFormat method. (If I could cast it to VFP's DataObject somehow my problems would end I think).
Any ideas?
TIA
Cetin