C++ Dll for Excel VBA
I wrote a dll in C++ to be called from Excel VBA. Two main problem arise…
1. Within the vba code there is the call to the dll. Well, after the execution of this line of code, I get an overflow error, I enter the debug mode and the it works fine again. It seems that the VBA code doesn’t wait for the dll to finish its computation.
2. This dll routine is called thousands of time and I notice during the execution, that the memory allocation (from task manager) grow awfully, till excel crashes since there’s no more memory available.
With other fortran dll, all this mess doesn’t happen!
Do you know where the problems can lie?
Thank you very much!!
>> Do you know where the problems can lie?
Not without seeing the code.
It's hard to stick..it is a 500 line code... Sorry!
Ok, I've slimmed a lot the original code...
Within Excel, I run the dll about 30000 times and I notice a steady increase in the memory allocation of excel (from Task Manager). How can I avoid this problem?
I suppose that, as soon as the dll has been terminated, the used memory is released, but it seems not to be the case... :(
void _stdcall AreaComputation (double *x,double *y,float omega,double *area,double *volume)
double *ra=new double[ns];
double *ha=new double[ns];
delete  ra,ha;
>> delete  ra,ha;
delete  ra;
delete  ha;
Thanx a lot!!!