The SFTBOX_VIRTUALDEF structure is used by VirtualInitialize to use the combo box control in virtual mode and to define the virtual data source.
typedef struct tagSftBoxVirtualFuncs {
DWORD version;
SFTBOX_DWORD_PTR userdataVirtPool;
LPFNSFTBOX_VGETITEM lpfnVGetItem;
LPFNSFTBOX_VRELEASEITEM lpfnVReleaseItem;
LPFNSFTBOX_VGETSTATUS lpfnVGetStatus;
LPFNSFTBOX_VSETSTATUS lpfnVSetStatus;
LPFNSFTBOX_VINDEXTOVISIBLE lpfnVCvtIndexToVisible;
LPFNSFTBOX_VVISIBLETOINDEX lpfnVCvtVisibleToIndex;
LPFNSFTBOX_VGETPARENTINDEX lpfnVGetParentIndex;
LPFNSFTBOX_VGETNEXTSIBLING lpfnVGetNextSibling;
LPFNSFTBOX_VGETPREVSIBLING lpfnVGetPrevSibling;
LPFNSFTBOX_VGETFIRSTSIBLING lpfnVGetFirstSibling;
LPFNSFTBOX_VGETLASTSIBLING lpfnVGetLastSibling;
SFTBOX_DWORD_PTR res1, res2, res4, res5, res6;
} SFTBOX_VIRTUALDEF, * LPSFTBOX_VIRTUALDEF;
typedef const SFTBOX_VIRTUALDEF * LPCSFTBOX_VIRTUALDEF;The SftBox/DLL version expected by the application. This value must be set to SFTBOX_VERSION (which is the same as SFTBOX_VERSION_60), otherwise the call to VirtualInitialize fails. The values SFTBOX_VERSION_40, SFTBOX_VERSION_45 and SFTBOX_VERSION_50 are also accepted.
An application-defined value. May be 0. This value is passed as userData parameter to all callback functions.
Required. A pointer to a callback function of type LPFNSFTBOX_VGETITEM. This function is called by SftBox/DLL to retrieve the information for one item (a pointer to a SFTBOX_ITEM structure) as it is needed by the combo box control.
Required. A pointer to a callback function of type LPFNSFTBOX_VRELEASEITEM. This function is called by SftBox/DLL to release item information previously retrieved using the LPFNSFTBOX_VGETITEM callback function.
lpfnVGetStatus, lpfnVSetStatus, lpfnVCvtIndexToVisible, lpfnVCvtVisibleToIndex, lpfnVGetParentIndex, lpfnVGetNextSibling, lpfnVGetPrevSibling, lpfnVGetFirstSibling, lpfnVGetLastSibling
Reserved. Must be set to NULL.
res1, res2, res4, res5, res6
Reserved. Must be set to 0. h1 Comments
The SFTBOX_VIRTUALDEF structure is used by VirtualInitialize to use the combo box control in virtual mode and to define the virtual data source. In virtual mode, the combo box control does not store the items. Instead, it retrieves the information for an item from the application when it is needed, using the callback functions defined by the SFTBOX_VIRTUALDEF structure. The callback functions receive the window handle of the combo box control. The number of items is defined using VirtualCount.
The structure must be initialized to 0 before setting its members. Only "flat" lists are supported when a virtual data source is used; hierarchies cannot be represented.
SFTBOX_VIRTUALDEF Virt; memset(&Virt, 0, sizeof(Virt)); Virt.version = SFTBOX_VERSION; Virt.userdataVirtPool = (SFTBOX_DWORD_PTR) lpMyData; // passed to the callback functions Virt.lpfnVGetItem = MyGetItem; Virt.lpfnVReleaseItem = MyReleaseItem; if (SftBox_VirtualInitialize(hwndCtl, &Virt)) SftBox_VirtualCount(hwndCtl, items, items, 0);
Pointer typedefs: LPSFTBOX_VIRTUALDEF is a pointer to a SFTBOX_VIRTUALDEF structure, LPCSFTBOX_VIRTUALDEF is a pointer to a constant SFTBOX_VIRTUALDEF structure.
See Also C/C++ API | Categories | Notifications