2024 Conversion questions
-
Hello,
I have a few questions about 2024 conversion that I am combining into 1 post.
The plugin is a object data plugin with resource description.- GetDParameter bitmapbutton
Bool GetDParameter(GeListNode *node, const DescID &id, GeData &t_data, DESCFLAGS_GET &flags) { switch (id[0].id) { case MY_BITMAP: { Int32 dirty = 0; BitmapButtonStruct bbs(static_cast<BaseObject*>(node), id, dirty); t_data = GeData(CUSTOMDATATYPE_BITMAPBUTTON, bbs); // ERROR flags |= DESCFLAGS_GET::PARAM_GET; break; }
- BaseSelect
BaseSelect* bs; if (polygonCnt > 0) { SelectionTag* sTag = SelectionTag::Alloc(Tpolygonselection); myObj->InsertTag(sTag, 0); bs = sTag->GetBaseSelect(); // ERROR
- IncludeExclude
InExcludeData* myList= (InExcludeData*)bc->GetCustomDataType(MY_ID, CUSTOMDATATYPE_INEXCLUDE_LIST); // ERROR
Thanks.
-
Hey @Rox,
Thank you for reaching out to us. You really should have a look at the migration guide, as these topics are covered there. We cannot debug every compiler error here for you, nevertheless here are the answers to your three problems:
// 1 - That should fix it as the signature is now: // GeData( const CustomDataType & data, Int32 type ) t_data = GeData(bbs, CUSTOMDATATYPE_BITMAPBUTTON); // 2 - Selections are now COW and make a distinction between being mutable and immutable. const BaseSelect* const mySelection = sTag->GetBaseSelect(); // immutable BaseSelect* const mySelection = sTag->GetWritableBaseSelect(); // mutable // 3 - Same story here, GetCustomDataType returns immutable data now, the method is also templated // now, so you do not need to cast things anymore. const InExcludeData* const myList= bc->GetCustomDataType<InExcludeData>(MY_ID); InExcludeData* const myList= bc->GetCustomDataTypeWritableObsolete<InExcludeData>(MY_ID);
Cheers,
Ferdinandedit: forgot the template argument in
BaseContainer::GetCustomDataType