I'm still struggling with rebuilding the mixer splitter example without ATL.
Thanks to the "AmsterCHEM COM CAPE-OPEN Wizard" I already got a frame for the unit operation. I also added a "Collection" class (.h and .cpp) implementing ICapeCollection. But looking in the CO-LaN example, a function "CCollection::CreateCollection()" is defined and implemented, that creates an ATL::CComObject instance:
Code: Select all
static CComObject<CCollection> *CreateCollection(const OLECHAR *name,const OLECHAR *description)
{CComObject<CCollection> *p;
CComObject<CCollection>::CreateInstance(&p); //create the instance with zero references
p->AddRef(); //now it has one reference, the caller must Release this object
p->name=name;
p->description=description;
return p;
}
How should I replace this function in an implementation without the ATL stuff?
The function is so far called in the constructor of the unit operation, before adding things to the collection:
Code: Select all
//create port collection
portCollection = CCollection::CreateCollection(L"Port collection", L"Port collection for CPP Mixer Splitter");
//add port
portCollection->AddItem(port);
Thanks in advance for any helpful replies.