This class will help you a lot when writing extensions that manipulates the SOL.
This framework is based loosely on the sourcecodes of the Select Object by Dynasoft.
- Resets the SOL by reselecting all objects
- Resets the SOL, not selecting any objects
- Resets the SOL and inserts one given object into it
- Resets the SOL and selects the given list of objects
- Returns true if the object is of the type (checks for qualifiers as well)
- Returns the number of selected objects for the given object type or qualifier.
- Runs a custom filter on the current SOL, removing objects that fails the callback test.
Returns a boolean if the event should run (already inverted by the negate flag for convenience)
//Should it select the given object? bool sampleFilter(LPRDATA rdPtr, LPRO object) { return (rdPtr->objectA == object || rdPtr->objectB == object); } long WINAPI DLLExport con_IsObjectRemembered(LPRDATA rdPtr, long param1, long param2) { //Initialize the object selection framework ObjectSelection select = ObjectSelection(rdPtr->rHo.hoAdRunHeader); //Gets a pointer to the event information structure and find out if the condition is negated PEVT pe = (PEVT)(((LPBYTE)param1)-CND_SIZE); bool isNegated = (pe->evtFlags2 & EVFLAG2_NOT); short oi = ((eventParam*)param1)->evp.evpW.evpW0; //Runs the "sampleFilter" callback on any object in the SOL. return select.FilterObjects(rdPtr, oi, isNegated, &sampleFilter); }