This sample is located in \Samples\Com\SafeArray.
Description
Using the Sample
Key Project Files
Technologies Demonstrated
A safe array is an array that contains information about the number of dimensions and the bounds of its dimensions.
This sample displays a DLL registry message box and the contents of a safe array.
To run the sample
nmake
run
A message box displays the following message:
DLLRegisterServer in SimpleObject.dll succeeded.
ComputeSum() returned 10 CreateSquares() returned { 0 1 4 9 16 25 36 49 64 81 100 } Converting results to Java array: { 0 1 4 9 16 25 36 49 64 81 100 }
To uninstall the sample
In the \Samples\Com\SafeArray directory, type:
remove
This file's main method instantiates a COM object, passes a SafeArray to that object, receives the SafeArray back from the COM object, and extracts SafeArray elements one at a time or translates the entire SafeArray to a Java array.
This sample shows how to: