When trying to do a drag and drop from a list view control to the desktop I get the following error:

This is file drop operation to the desktop.


System.Runtime.InteropServices.COMException crossed a native/managed boundary
Message=Invalid FORMATETC structure (Exception from HRESULT: 0x80040064 (DV_E_FORMATETC))
Source=mscorlib
ErrorCode=-2147221404
StackTrace:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Windows.Forms.DataObject.System.Runtime.InteropServices.ComTypes.IDataObject.GetDat aHere(FORMATETC& formatetc, STGMEDIUM& medium)
at System.Windows.Forms.DataObject.System.Runtime.InteropServices.ComTypes.IDataObject.GetDat a(FORMATETC& formatetc, STGMEDIUM& medium)
InnerException:






Here is some sample code:

Dim myItem As ListViewItem
'Create an array of strings.
Dim myItems(lvwLocalDir.SelectedItems.Count - 1) As String
Dim i As Integer = 0

Dim path1 As String = IO.Directory.GetCurrentDirectory

If path1.EndsWith("\") = False Then
path1 += "\"
End If
Dim pathReset As String = path1

'Loop though the SelectedItems collection of the ListView control.
For Each myItem In lvwLocalDir.SelectedItems
'Add the Text of the ListViewItem to the array.
path1 += myItem.Text
myItems(i) = path1
path1 = pathReset

'myItems(i) = myItem.Text
i = i + 1
Next


' Creates a data object.
Dim myDataObject As New DataObject()

' Adds the component to the data object.
myDataObject.SetData(DataFormats.FileDrop, myItems)



'DoDragDrop begins the drag-and-drop operation.
'The data to be dragged is the array of strings.
lvwLocalDir.DoDragDrop(myItems, DragDropEffects.Copy)

'Catch ex As Exception
' Stop
'End Try





Dim j As ListViewItem
For Each j In lvwLocalDir.SelectedItems
'Remove the ListViewItem from the ListView control.
lvwLocalDir.Items.Remove(j)
Next


Do you have any Ideals of how I can fix this problem?

Thanks,
QWERT