I had problems with this in VB 6, so I thought I might share.
I couldn't get drag and drop from a VB 6 program to work. The reason?
Incomplete documentation!
MSDN gives two possible values for the allowedeffects parameter of the
OLEStartDrag event, vbDropEffectCopy and vbDropEffectMove, but Inventor
expects a third value: 4. This value is documented for VB.Net
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsdragdropeffectsclasstopic.asp),
but not VB 6.
All it takes to drag a file from your VB6 program is:
1. Set your control's OLEDragMode to Automatic
2. Add this code:
Private Sub YourControlName_OLEStartDrag(Data As MSComctlLib.DataObject,
AllowedEffects As Long)
Const vbDropEffectLink = 4
Data.SetData , vbCFFiles
Data.Files.Add "C:\Temp\YourFile.ipt"
AllowedEffects = vbDropEffectLink
End Sub
Enjoy!
Erling