Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

VirtualInitialize

Initializes a tree control for virtual mode and for use with a virtual data source.

C

BOOL WINAPI SftTree_VirtualInitialize(HWND hwndCtl, LPCSFTTREE_VIRTUALDEF virt);
BOOL WINAPI SftTreeSplit_VirtualInitialize(HWND hwndCtl, LPCSFTTREE_VIRTUALDEF virt);

C++

BOOL CSftTree::VirtualInitialize(LPSFTTREE_VIRTUALDEF virt);
BOOL CSftTreeSplit::VirtualInitialize(LPSFTTREE_VIRTUALDEF virt);

Parameters

hwndCtl

The window handle of the tree control.

virt

A pointer to a SFTTREE_VIRTUALDEF structure describing the virtual data source. Specify NULL to discontinue using the tree control in virtual mode.

Returns

The return value is TRUE if the function was successful, otherwise FALSE is returned.

Comments

The VirtualInitialize function initializes a tree control for virtual mode and for use with a virtual data source.

Once items have been added to a tree control using AddString or InsertString, VirtualInitialize can no longer be used.

Examples

C

        /* routines used are defined below.                        */
        {
            SFTTREE_VIRTUALDEF virt = {
                SFTTREE_VERSION_700,
                0,
                Tree_VirtualStorageGetItemCallback,
                Tree_VirtualStorageReleaseItemCallback,
            };
            if (!SftTreeSplit_VirtualInitialize(g_hwndTree, &virt))
                ; /* error handling goes here */
            /* Set current number of items in the control.             */
            if (!SftTreeSplit_VirtualCount(g_hwndTree, 1000000L, 1000000L, 0))
                ; /* error handling goes here */
        }

        SftTreeSplit_SetShowHeader(g_hwndTree, TRUE);/* Show column headers */

C++

    /* back routine.                                          */
    {
        SFTTREE_VIRTUALDEF virt = {
            SFTTREE_VERSION_700,
            (SFTTREE_DWORD_PTR)(LPVOID)this,
            VirtualStorageGetItemCallback,
            VirtualStorageReleaseItemCallback,
        };
        if (!m_Tree.VirtualInitialize(&virt))
            return -1; /* error handling goes here */
        /* Set current number of items in the control.             */
        if (!m_Tree.VirtualCount(1000000L, 1000000L))
            return -1; /* error handling goes here */
    }

    m_Tree.SetShowHeader(TRUE);          /* Show column headers */

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