Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

SFTTREE_DWORD_PTR Type Definition

Defines a type large enough to hold a DWORD or pointer value.

typedef DWORD_PTR SFTTREE_DWORD_PTR;

Comments

SFTTREE_DWORD_PTR defines a type large enough to hold a DWORD or pointer value.

On Intel 32-bit platforms (IX86), a DWORD and pointer value have the same size (4 bytes). The SFTTREE_DWORD_PTR type was introduced to support 64-bit platforms, where a DWORD and a pointer do not have the same size.

In earlier releases of SftTree/DLL, certain fields were defined using the generic type DWORD. These have been replaced with SFTTREE_DWORD_PTR, where a pointer or DWORD value needs to be saved.

Examples

C

    nCols = SftTree_GetColumnsEx(hwndTree, &lpCol);/* Get column attributes */
    Sft_SetPictureUpDownSort(&lpCol[0].Picture1, fAscending ? 1 : 0, PIC_SIZEX_SORT, PIC_SIZEY_SORT, TRUE);
    SftTree_SetColumnsEx(hwndTree, nCols, lpCol);  /* Set new column attributes */

    g_fAscending = fAscending;
}

int CALLBACK SortCallbackExAscending(HWND hwnd, LPCTSTR lpszString1, LPCTSTR lpszString2, 
                  SFTTREE_DWORD_PTR itemData1, SFTTREE_DWORD_PTR itemData2) 
{
    return lstrcmp(lpszString1, lpszString2); 
} 

int CALLBACK SortCallbackExDescending(HWND hwnd, LPCTSTR lpszString1, LPCTSTR lpszString2, 
                  SFTTREE_DWORD_PTR itemData1, SFTTREE_DWORD_PTR itemData2) 
{

C++

    nCols = m_Tree.GetColumns(&lpCol);/* Get column attributes */
    Sft_SetPictureUpDownSort(&lpCol[0].Picture1, fAscending ? 1 : 0, PIC_SIZEX_SORT, PIC_SIZEY_SORT, TRUE);
    m_Tree.SetColumns(nCols, lpCol);  /* Set new column attributes */

    m_fAscending = fAscending;
}

/*static */ int CALLBACK CSampleView::SortCallbackExAscending(HWND hwnd, LPCTSTR lpszString1, LPCTSTR lpszString2, 
                  SFTTREE_DWORD_PTR itemData1, SFTTREE_DWORD_PTR itemData2) 
{
    return lstrcmp(lpszString1, lpszString2); 
} 

/*static */ int CALLBACK CSampleView::SortCallbackExDescending(HWND hwnd, LPCTSTR lpszString1, LPCTSTR lpszString2, 
                  SFTTREE_DWORD_PTR itemData1, SFTTREE_DWORD_PTR itemData2) 
{

See Also C/C++ API | Categories | Notifications