I am trying to translate this pb code into fb code, its almost working.
How do i fix ' error 264: Symbol not a CLASS, ENUM, TYPE or UNION type, before '.' in 'Select Case @pNMTV.hdr.idfrom' ?
Code: Select all
Type TV_HANDLES
nNode1 as HANDLE
nNode2 as HANDLE
nNode3 as HANDLE
End Type
Dim Shared tvNodes as TV_HANDLES
Function FORM1_WM_CREATE ( _
hWndForm as HWnd, _ ' handle of Form
ByVal UserData as Integer _ ' optional user defined value
) as Long
Print hWndForm
Print HWND_FORM1_TREEVIEW1
TreeView_SetBkColor( HWND_FORM1_TREEVIEW1, &hfff0e1 ) 'macro
tvNodes.nNode1 = FF_TreeView_InsertItem( HWND_FORM1_TREEVIEW1, TVI_ROOT, "First Item" )
tvNodes.nNode2 = FF_TreeView_InsertItem( HWND_FORM1_TREEVIEW1, TVI_ROOT, "Second Item" )
tvNodes.nNode3 = FF_TreeView_InsertItem( HWND_FORM1_TREEVIEW1, TVI_ROOT, "Third Item" )
Function = 0 ' change according to your needs
End Function
'--------------------------------------------------------------------------------
Function FORM1_CUSTOM ( _
hWndForm as HWnd, _ ' handle of Form
wMsg as UInteger, _ ' type of message
wParam as WPARAM, _ ' first message parameter
lParam as LPARAM _ ' second message parameter
) as Long
Dim nNode as Long
Dim pNMTV as NMTREEVIEW Ptr '<--- use this pointer for Treeviews ?
Select Case wMsg
Case WM_NOTIFY
pNMTV = lParam
Select Case @pNMTV.hdr.idfrom ' error 264: Symbol not a CLASS, ENUM, TYPE or UNION type, before '.' in 'Select Case @pNMTV.hdr.idfrom'
' Select Case @pNMTV.hdr.idfrom
'
' Case IDC_FORM1_TREEVIEW1
'
' Select Case @pNMTV.hdr.Code
'
' Case NM_CLICK 'left click
' Case NM_DBLCLK 'left double-click
Case NM_RCLICK ' right click
' nNode = FF_TreeView_GetSelection( HWND_FORM1_TREEVIEW1 )
' Print "Node right clicked: " & nNode
' Case NM_RDBLCLK 'right double-click
'
' End Select
'
End Select
End Select
Function = 0 ' change according to your needs
End Function