Ticket #14700 (closed enhancement: fixed)
Allow to receive a multidimensional SafeArray as a result of wxAutomationObject call
|Reported by:||PB||Owned by:|
This is related to #14637, particularly (comment 4)
It would be also nice to do something about the TODO in wxConvertOleToVariant()...
I propose a solution contained in the attached patch, it is a kludge but I really can't think of anything better.
Actually, having returned SafeArray only when it has more than one dimension might not be always for the best, e.g. when you get the values of MS Excel's Range.Value, this way you can get either a wxVariant with the list type if the Range has just one row or wxVariant with wxVariantDataSafeArray type if it has more - so you have to have two different code paths handling the returned values in the user code. But having two options, e.g. wxOleConvertVariant_ReturnSafeArrayAlways, wxOleConvertVariant_ReturnSafeArrayMultiDOnly may seem like an overkill...
The wxOleConvertVariant flags could be used for other "hacks", e.g. the one that attempts to fix wxAutomationObject::Invoke() breaking the contract and silently modifying its input parameters declared as const while still preserving the backward compatibility, also demonstrated in the attached patch.
As this just a proposal of a solution, I haven't written doxygen documentation for it yet.