for (int i = 0; i<2; i++)
psa = SafeArrayCreate( VT_R4, 1, sabound );
float HUGEP* ResData;
SafeArrayAccessData(psa, (void HUGEP**)&ResData);
ResData = 1.5; //just for test
ResData = 0.75;//just for test
V_VT(&TEMPORARY ) = VT_ARRAY | VT_R4;
V_ARRAY(&TEMPORARY) = psa;
the vb side:
Dim tab1(1) As Variant
i did a mistake, the problem have nothing to do with Variant or
SafeArray, i just used an old code for testing how to create a table
of tables of different sizes, and i didn't see that in excel i had a
function, not a sub, so excel was waiting for a return value that C++
doesn't send, and the fact that it crashes at VariantCopy, confused
me, so i didn't think about other possible problems.
In general, ask yourself, "Would my question be essentially the same
in a different programming language?".
If you answer yes, then you probably should post in a newsgroup
dedicated to general programming.
Also ask yourself, "Does this question make sense for a different
platform (i.e. Linux/Mac instead of Windows)?".
If you answer yes, then it would probably be on topic here. If the
answer is no, then you are probably better off
posting to a newsgroup dedicated to your platform.
In both cases, a reasonable set of suggested newsgroups can be found
in FAQ 5.9.
Please feel free to bring your C++ specific questions here, we'll be
glad to help.