Hi!
I guess Microsoft did not provided enough details on that topic. Redimensioning works well with in-process DLL just because such COM object runs in the same memory space as main application. So, when you try to redimension array, you have full access to the memory of the main application.
When you use Out-of-process COM object, it runs in completely separate memory space as completely separate Windows process. This cause limited access to the memory of the application that called such COM object. I believe this is a cause of error when trying to redimension array in such COM object.
Hope this is good confirmation of such behavior.
Finally, I solved that problem by another way. Define two methods for COM object. One will calculate required array dimensions, another will fill array. So, data query into array will look like following:
1. Call 'GetData' method with query string. It returns array dimensions for result array.
2. Prepare result array.
3. Call 'FillArray' method to fill array by result.
I doubt, however, it will work with COM+/MTS, because MTS may cause 'GetData' and 'FillArray' methods will call different objects, but who knows? I have no much experiense with that.
>FYI:
> Despite what Microsoft states in Q230729 "COM Servers Cannot Redimension Arrays Passed by Reference", VFP6 SP4(version 06.00.8862.00) still seems to have a problem redimensioning arrays passed to a COM object by reference.
> I used COMARRAY(oServer,11) to allow passing arrays by reference. The method that I am calling redimensions the array (via ACOPY) and fills it in. When I compile the component as a DLL (in-process-server) the method call works as expected. When I compile the component as an EXE (out-of-process-server) I get 'OLE error 80020010 invalid callee.' unless the array has the same dimensions as it will have after the ACOPY.
> Can anyone confirm/explain this behavior?
>
>Thanks,
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.