May 31st, 1999, 09:14 AM
I have an array of doubles in VB that I want to pass to a COM object in C++ (which is an In-Proc DLL). Acturally, all I really want is a pointer to the array..
With a standard DLL, you can simply Define the function to pass the first element of the array ByRef to the DLL which expects to receive a pointer (double *) to the array. This doesn't seem to work with COM since you cannot specify whether the variable is passed ByVal or ByRef (please let me know if I'm wrong here!). All tests I've done seem to show that the data is passed ByVal.
Can someone tell me how to send an array of doubles (or at least a pointer to their location) to a COM object? I have seen the term SAFEARRAY used, but am unfamiliar with how the COM object can receive a SAFEARRAY since it is not valid COM Data Type...
Thank you very much. Jeff
With a standard DLL, you can simply Define the function to pass the first element of the array ByRef to the DLL which expects to receive a pointer (double *) to the array. This doesn't seem to work with COM since you cannot specify whether the variable is passed ByVal or ByRef (please let me know if I'm wrong here!). All tests I've done seem to show that the data is passed ByVal.
Can someone tell me how to send an array of doubles (or at least a pointer to their location) to a COM object? I have seen the term SAFEARRAY used, but am unfamiliar with how the COM object can receive a SAFEARRAY since it is not valid COM Data Type...
Thank you very much. Jeff