cyrilchacko
15th January 2009, 16:28
Hi,

I am creating a session wherein I am to compare Quotations from different suppliers. For this they need the tax calculation break up as well.

For this instead of writing out the logic, I tried using the DLL tctax.dll9141, namely the function tctax.dll9141.determine.aggregate.tax.amounts.per.line.

Here, I need to pass only the Aggregate Tax Code, Tax Country, Price Calculations, Assesable Values, few flags and the arrays for returning the values for the tax layers.

This is the DLL used in Tax Calculator as well.

The DLL gives me all the values, correctly. However, sometimes when I run the session, the Baan gives the error "server connection lost" and terminates. This I believe is due to the memory manipulations taking place. The DLL makes it clear that I have to use free.mem.

This is the first time I am using free.mem and alloc.mem. So, I am not sure of the exact usage. If a variable is declared, then before it is used in alloc.mem, do I have to do free.mem?

Or is free.mem to be used, only at the program termination, as it is used in C (malloc and free)?

Right now, I am freeing the memory as soon as report is being sent. One last question, after alloc.mem is done, do I need to necessarily do a free.mem before doing an alloc.mem? It is not mentioned anywhere in the Programmer's Guide.

Thanks in advance
Cyril

cyrilchacko
8th April 2009, 07:20
Hi,

I was not declaring the arrays as based and hence the error.

Thanks
Cyril Chacko