Hi Guys,
This is part of my code to create a drag image of the treeview item being dragged:
I get an invalid use of AddressOf operator on the line I have highlighted in red. Please helpCode:Public Sub TreeView_StartDrag( _ ByVal hWndTreeView As Long, _ Optional ByVal x As Long = 20, _ Optional ByVal y As Long = 20) Dim tPoint As POINTL Dim hItem As Long ' Get the selected node hItem = SendMessage(hWndTreeView, TVM_GETNEXTITEM, TVGN_DROPHILITE, ByVal 0&) ' Get a ImageList with the drag image m_lIL = SendMessage(hWndTreeView, TVM_CREATEDRAGIMAGE, 0, ByVal hItem) ' Start the image dragging ImageList_BeginDrag m_lIL, 0, x, y ImageList_DragEnter 0, 0, 0 ' Start the timer m_lTimer = SetTimer(0, 0, 1, AddressOf pvTimerDragMove) End Sub Private Sub pvTimerDragMove( _ ByVal hWnd As Long, _ ByVal uMsg As Long, _ ByVal idEvent As Long, _ ByVal dwTime As Long) Dim tPoint As POINTL ' Get the cursor position GetCursorPos tPoint ' Move the image to the new cursor position ImageList_DragMove tPoint.x, tPoint.y End Sub




Reply With Quote