Pages: 1
Author Topic: ChooseTemplate issue  (Read 2820 times)
Polly Poon

Posts: 8

« on: March 03, 2010, 01:31:22 AM »


I am using XMetaL 5.5 .

I have created a function to override the File > New operation with the following:

string newFilePath = null;
newFilePath = this.xMetalHelper.getApplication().Documents.ChooseTemplate();

where this.xMetalHelper.getApplication() would return an existing instance of XMetaL.Application.

I found that during runtime, if i click on the Cancel button on the ChooseTemplate dialog, XMetaL cannot be shut down properly, a remant instance would be left and I have to go to Task Manager to clear the process.

Is there a way to properly handle the ChooseTemplate process? How to exit gracefully if a user click the Cancel button on the ChooseTemplate dialog so there won't be memory leak?

« Last Edit: March 03, 2010, 01:32:55 AM by Polly Poon » Logged
Derek Read
Program Manager (XMetaL)

Posts: 2621

« Reply #1 on: March 03, 2010, 01:30:42 PM »

I'm not sure I understand the need to instantiate XMetaL Author as a COM object here (unless this script is not living inside an MCR file, which seems likely as this code looks like C# or something).

I don't think this has anything to do with a particular API in the product. One reason it might not shut down properly is because there is an open reference to it somewhere.

Try to find an appropriate place to explicitly (on purpose) destroy the reference as soon as possible after you no longer need it and you should be OK.

If you think this is a bug in the product please submit a case to XMetaL Support including complete sample code to reproduce it. If possible, simplify the project to the point where it only contains just enough code to reproduce the issue as code that does something not directly related to the issue will confuse things.
« Last Edit: March 03, 2010, 01:33:47 PM by Derek Read » Logged
Pages: 1
Jump to:  

email us