Hi there,

I would like to use a dialogue box message handling function to add some strings and data to combo boxes. I would also however like to avoid the use of global variables if possible.

I can access the structs I make inside the message handling function if I declare structs globally but I don't think I should be doing that. What I'd like to do is call a function inside the message procedure that retrieves data from the hardware about rendering capabilities and then adds the strings and corresponding data to items in the combo boxes.

How would I achieve this without using a global variable. I would really like to just declare a resizable array of structs in the main function and then have the function in the dialogue message handler fill them up with data retrieved from hardware which can then be added to the combo boxes.

So the function inside the message handler would need access to the array of structs to fill them, and so would the functions that add data to the combo boxes when copying stuff across from the structs.

I could modify the standard message handler function call to accommodate a pointer to the array but I feel that messing with windows this way is a bad idea.

I know this all sounds a bit windowsey for the general C++ forum but I felt the majority of concerns are routed in C++ wisdom rather than windows, so I posted it here.

Could I maybe get around this by just declaring a resizable array (vector from STL) as a static variable inside the main function? Would the message handler be able to access it then?

Thanks