Since you're using C++, you could make the array a member variable of the dialog class, initialize the array when the dialog is created, then use the array in the click message handler of the button, which should be a member method of the dialog class.
Also, since you're using the Measurement Studio C++ libraries, you can use the CNiScalarVector data types (for example, CNiReal64Vector). That way you don't have to worry about memory management via malloc, you will have several useful methods for working with the array from the vector class, and you'll be using a data type that integrates well with the Measurement Studio C++ hardware, analysis, and user interface libraries.
- Elton