Page 1 of 1

Deleting ADR Template

Posted: Wed Aug 26, 2009 8:25 am
by ganeshj
I have created a template config with 3 templates.

Once i have created this how is it possible to delete a template.

Please see below code.

Code: Select all

Imaging1.ADRLoadTemplateConfig(_strTemplatesFolder + "\\templateconfig.t");

Imaging1.ADRGetTemplateImageCount(template); 
"Returns 1. Template Count is also 1"
Imaging1.ADRDeleteTemplate(template);
Imaging1.ADRGetTemplateImageCount(template);
"Returns 0"
gdStatus = Imaging1.ADRSaveTemplateConfig(_strTemplatesFolder + "\\templateconfig.t"); "Saving changes"

Imaging1.ADRLoadTemplateConfig(_strTemplatesFolder + "\\templateconfig.t");
Imaging1.ADRGetTemplateImageCount(template);
"Still returns 1 and Template Count also is 1"

The delete only seems to remove it from memory the changes are not persisted to the config.
Can you let me know how i can remove a template from the config file.

Re: Deleting ADR Template

Posted: Wed Aug 26, 2009 11:01 am
by Loïc
Hi,

The reason is the function ADRSaveTemplateConfig doesn't do anything if your number of template is equal to 0.

I suggest you this way:

If you have 1 template or more: Save the template configuration, else: delete or empty the template configuration file.

With best regards,

Loïc

Re: Deleting ADR Template

Posted: Wed Aug 26, 2009 12:57 pm
by ganeshj
Thanks i will try this.