You can get the HWND of a dialog control using:
You can then use the normal functions for tree-view controls:
hwndTree = GetDlgItem(hDlg, ID_DIRTREE);
Alternatively, you can use SendDlgItemMessage in place of SendMessage:
With this knowledge, you should be able to convert the MSDN sample code to your needs.
SendDlgItemMessage(hDlg, ID_DIRTREE, TVM_DELETEITEM, 0, (LPARAM) hItem);
This applies to all dialog controls, not just tree-views.
I don't know much about MFC but:
>> tried passing it one and the compiler tells me that it can't convert class "CDialog" to class "CWnd *",<<
No, but it can probably convert a pointer to a CDialog object to a pointer to a CWnd object.