dcsimg
Results 1 to 2 of 2

Thread: [RESOLVED] Unable to drag drop in windows 7 64 bit

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2008
    Posts
    40

    Resolved [RESOLVED] Unable to drag drop in windows 7 64 bit

    Good Evening,

    I've got an issue that I've been sporadically going back to over the course of a few weeks and am unable to resolve. In Windows 7 (I'm using the 64 bit professional edition) I am unable to drag and drop files. I know the code works as I've been using the application on a 32 bit XP for ages.

    I've set the allowdrop property for both the main form and the status strip.

    The code being used is:

    Code:
    Private Sub objStatusStrip_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles objStatusStrip.DragDrop
    
            ' Functionality to drag and drop emails to go into supportworks here.
            Try
    
                If (e.Data.GetDataPresent("Object Descriptor")) Then
                    Dim myMem As New MemoryStream
                    Dim myByte As Byte()
                    Dim strCheck As String = ""
                    myMem = DirectCast(e.Data.GetData("Object Descriptor"), MemoryStream)
                    myByte = myMem.ToArray
                    myMem.Close()
                    For i As Integer = 0 To myByte.Length - 1
                        If myByte(i) < 0 Then
                            strCheck += Convert.ToChar(myByte(i))
                        End If
                    Next
    
                    If LCase(strCheck).IndexOf("outlook") - 1 Then
                        Dim myOlApp As Outlook.Application = CreateObject("Outlook.Application")
                        Dim myExp As Outlook.Explorer = myOlApp.ActiveExplorer
                        Dim myMailItem As Outlook.MailItem
                        myMailItem = DirectCast(myExp.Selection.Item(1), Outlook.MailItem)
                        Dim objNewOutlookEmailInformation As New OutlookEmailInformation
                        objNewOutlookEmailInformation.Body = myMailItem.Body
                        objNewOutlookEmailInformation.Subject = myMailItem.Subject
                        objNewOutlookEmailInformation.EmailTo = myMailItem.To
                        objNewOutlookEmailInformation.SenderName = myMailItem.SenderName
                        objNewOutlookEmailInformation.SenderEmail = myMailItem.SenderEmailAddress
                        objNewOutlookEmailInformation.SentOn = myMailItem.SentOn
                        objNewOutlookEmailInformation.RecievedTime = myMailItem.ReceivedTime
                        objNewOutlookEmailInformation.HTMLBody = myMailItem.HTMLBody
    
                        MsgBox(objNewOutlookEmailInformation.SenderEmail)
    
                        myExp = Nothing
                        myMailItem = Nothing
                        myOlApp = Nothing
                    End If
    
                End If
    
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
    
        End Sub
    
        Private Sub objStatusStrip_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles objStatusStrip.DragEnter
    
            Try
    
                If e.Data.GetDataPresent("Object Descriptor") Then
                    e.Effect = DragDropEffects.Copy
                ElseIf e.Data.GetDataPresent(DataFormats.FileDrop) Then
                    e.Effect = DragDropEffects.Copy
                Else
                    e.Effect = DragDropEffects.None
                End If
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
        End Sub
    I've knocked the UAC settings down a notch and this doesn't do anything either. Interestingly, it's not even showing any of the dragdrop effects when dragging files or outlook emails into them.

    Any suggestions would be most helpful

  2. #2

    Thread Starter
    Member
    Join Date
    Oct 2008
    Posts
    40

    Re: Unable to drag drop in windows 7 64 bit

    Ok this was due to the UAC settings, the program being copied from (in this case Outlook) needs to be run on the same permission level as the application - which is by default running as administrator

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width