THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 30/08/2004 at 23:19, xxxxxxxx wrote:
Hi Mikael,
I tried to rewrite COFFEE code in VC++, but it happened what I was affraid.
I have no experiences in C++ an I'm a poor architect some delphi practise so I will haven't too much practise in the future (i think
).
I don't know the right way to create new RenderData object and copy into a BaseContainer data from existing RenderData.
I would like to duplicate the selected render settings.
You can see the different codes. the coffee codes works properly except the GetName() function, the C++ codes works properly except the duplicate BaseContainer data :)))
the COFFEE code:
var bc3;
var ind;
var i;
var count;
var render;
var newbc = new(BaseContainer);
var newrender = new(RenderData);
doc = GetActiveDocument();
render = doc->GetFirstRenderData();
render->GetContainer()->CopyTo(newbc);
newbc->SetData(RDATA_NAME,"FX created");
newrender->SetContainer(newbc);
doc->InsertRenderData(newrender, NULL);
The C++ code
BaseContainer bc;
BaseContainer newbc;
RenderData *rdata;
RenderData *newrdata;
BaseDocument *doc;
doc = GetActiveDocument();
rdata = doc->GetFirstRenderData();
name = "Copy of_" + rdata->GetName();
bc = rdata->GetData();
newrdata = rdata->Alloc();
newbc = BaseContainer();
newbc = bc();
newrdata->SetName(name);
newrdata->SetData(newbc,TRUE);
doc->InsertRenderData(newrdata,NULL);
thank you.
bye
Fuxy