smays wrote:Anyway, do either of you think it would be safe to 'embed' these dynamically allocated string matrices in my own class? I would like to add basic functionality such as IndexOf(), etc...
Of course it would be safe.
smays wrote:What, if anything, do I need to do to clean up this dynamically allocated matrix? Especially if I embed it in a class.
Nothing at all (unless you are dynamically allocating extra memory yourself). The beauty of STL containers is that they manage their own memory for you.
smays wrote:Another question, is it possible to pass a pointer to this vector to a function.
Of course. std::vector is a class like any other (just a templated class), and instances of it operate like normal objects like any other.
smays wrote:For example, say I want to show this data in a grid, but I do not want eat up screen space with another grid, so I pop open a form with a TStringGrid. Is it possible to pass a pointer to the new form and let the new form copy the data to the grid or whatever I have it do?
Sure. On the other hand, I would suggest switching to a TListView in report mode, or to a TVirtualTreeView. That way, you can utilize their virtual modes so you do not have to copy the data into the grid at all, thus reducing your memory overhead while also speeding up the grid in general.