A7Zulu

am having some trouble keeping my global variables alive. At the top I have some excel floating point arrays declared

LPFP deposits_zero;
LPFP swaps_zero;
LPFP futures_zero;
LPFP fra_zero;
LPFP blend_zero;

Now I have a function that is called that sets the deposits, swaps, futures, and fra curve with an array that is dynamically allocated.

deposits_zero = USA_CREATE_SWAPZERO(0,0,0,0,curve,&tmpBlend, 1, 1, 3, 0,0,0);

It creates a curve, the function is supposed to dynamically allocate my that array.

Now later on in my code, I have a function that uses all 4 of those arrays that were set by previous functions. The problem is those arrays aren't there anymore. Whats my problem

I am also having trouble getting my Visual Studio to debug my XLL.


Thanks,
Aaron


Re: Visual C++ General keeping global variables alive in xll

Bruno van Dooren

This is a Visual C++ forum.

Try asking in an Excel forum or Visual Studio tools for office forum.





Re: Visual C++ General keeping global variables alive in xll

A7Zulu

i am more or less having trouble understanding how memory allocation works. if i declare global variables in my xll, then i have accessors and mutators. I should be able to pull out a value that a previous function stored. but instead everything is disappearing. also what happens when things are multithreaded are there multiple instances of the xll in memory

thanks





Re: Visual C++ General keeping global variables alive in xll

Simple Samples

Try to describe the problem more in terms of C++ and less in terms of Excel. I am sorry, but I don't see a question about C++.




Re: Visual C++ General keeping global variables alive in xll

A7Zulu

i have a global pointer, in a function i malloced some memory for that pointer. then in another function i access that memory but its not there. is there something regarding multithreading that i should be concerned about. is there something i am overlooking thanks