Implementing multidimensional Quicksort
I have a function that returns a multidimensional VARIANT array of strings of the form:
[0, 0] Item Name String
[0, 1] Class Name String
[0, 2] Description String
In the first dimension this goes from 0 to 3000. I have been attaching to a COleSafeArray to access the strings using the GetElement method.
I'm writing the data to file and I need to sort the array in ascending order of Item Name, making the appropriate reorganisations of the other two dimensions.
I have a quicksort that seems to work well with a one dimensional CStringArray, but can't seem to make it work with my multidimension COleSafeArray.
Any body got any tips or ideas?
Yep, that would work, but...
I'm re-using OLE automation calls (that (must) return variants internally). I'm trying to avoid re-writing the functions that get my data (since they all exist already).
At the moment I'm just having trouble sorting one dimension in my COleSafeArray, but the damn thing is hard to watch, so I can't tell what is going on!