Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to drag and drop a file from VB 6 into an assembly

1 REPLY 1
Reply
Message 1 of 2
Anonymous
235 Views, 1 Reply

How to drag and drop a file from VB 6 into an assembly

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
1 REPLY 1
Message 2 of 2
avbuiten
in reply to: Anonymous

thanks for this notification.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report