Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataObject.SetData() in an Activex control
Message
From
29/03/2007 15:57:22
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
DataObject.SetData() in an Activex control
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01210037
Message ID:
01210037
Views:
73
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) 
* this returns text adding necessary fragment info like "StartHTMLFragment:offset ..."

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 bold

As 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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Next
Reply
Map
View

Click here to load this message in the networking platform