
ole drag&drop of file from an activex/ treeview headache
Hello,
we have an ActiveX control which contains a treeview that displays
files. We want to let users drag those files and drop them in an
application (SolidWorks) that would open them as from any Windows
Explorer window.
We implemented this code:
Private Sub TreeView1_OLESetData(Data As ComctlLib.DataObject,
DataFormat As Integer)
Data.Files.Add App.Path & "\Cylindre.SLDPRT", 1
End Sub
Private Sub TreeView1_OLEStartDrag(Data As ComctlLib.DataObject,
AllowedEffects As Long)
Data.SetData , vbCFFiles
AllowedEffects = vbDropEffectCopy
End Sub
Everything works fine then the ActiveX is run as a separate
application. When we integrate the ActiveX as a SolidWorks add-in, a
crash occurs when the cursor crosses the activex border.
First we supsected a problem with SolidWorks (you know, when there is
a bug it's always someone else's fault..) But then we replaced our
control with FileViewX from www.mabry.com and it worked... Even
stranger : if we include both our (standard) treeview and the
FileViewX control in our ActiveX, drag&drop from our control works
after a successful drag&drop from FileViewX.
So I guess we have to do something to initilialize our control
properly for OLE drag&drop, but what ?
Philippe Guglielmetti
www.DynaBits.com - mechanical design automation software