The wpclsInsertMultipleObjects method is used to insert multiple objects into a container window at one time. The following shows the syntax of wpclsInsertMultipleObjects:
#define INCL_WINWORKPLACE #include <os2.h> BOOL wpclsInsertMultipleObjects(M_WPObject *self, HWND hwndCnr, PPOINTL pptlIcon, PVOID *pObjectArray, PVOID pRecordParent, ULONG NumRecords)
The self (M_WPObject *) parameter is the pointer to the WPObject class object.
The hwndCnr (HWND) parameter is the handle of the container window to insert objects into.
The pptlIcon (PPOINTL) parameter is the pointer to a POINTL structure specifying the coordinates for the position of the first object inserted.
The pObjectArray (PVOID *) parameter is the pointer to an array of object pointers. The objects in this array are to be inserted into the container.
The pRecordParent (PVOID) parameter is the parent record pointer. This parameter should be set to NULL if the records being inserted will not have a parent or if the Tree view is not supported.
The NumRecords (ULONG) parameter is the number of objects in the pObjectArray parameter.
The rc (BOOL) parameter is returned with one of the following values:
Boolean
This method is used for the rapid insertion of multiple objects into the container all at once. The wpCnrInsertObject method performs the same function as this method but operates on only one object at a time. This method will add each of the objects to the in-use list. The following figure shows the insertion of multiple objects into a container control window:
BOOL wpclsInsertMultipleObjects(M_WPObject *self, HWND hwndCnr, PPOINTL pptlIcon, PVOID *pObjectArray, PVOID pRecordParent, ULONG NumRecords) M_WPObject *self; HWND hwndCnr; POINTL ptlIcon; PVOID pObjectArray{5}; ULONG i; /************************************************************************/ /* pObjectArray has been filled in with pointers to objects */ /* created using WinCreateObject or wpClsNew */ /************************************************************************/ /************************************************************************/ /* Initial location for first object being inserted. */ /************************************************************************/ ptlIcon.x = 50; ptlIcon.y = 50; /************************************************************************/ /* Inserting multiple objects. */ /************************************************************************/ _wpclsInsertMultipleObjects(self, hwndCnr, &ptlIcon, &pObjectArray, NULL,5);