The following Visual Basic .NET example creates two arrays and passes them to IDL using the SetIDLVariable method. An ExecuteString command then multiplies the two arrays and GetIDLVariable returns the result to the COM application. The product of the array multiplication is printed to the console window.
- Create a new Visual Basic .NET console application and add a reference to the COM_IDL_connectLib 1.0 Type Library.
- Replace the default module definition with the following code. See code comments for useful information.
Note: The text file for this example, com_export_arrays_doc.txt, is located in the examples/doc/bridges/COM subdirectory of the IDL distribution. This Visual Basic .NET code can be copied from the text file and adopted for use in your COM environment.
Building and running this program outputs the following to the console window.