When an Automation server receives a string or array as a method argument, it is temporarily allocated a value (an instance of <ole-array>, <BSTR>, or <ole-vector>) that is deleted after the method returns, so you will need to make a copy of the data if you want to keep it. You can use the function copy-automation-value to do this. (Copying is done automatically when setting a property.)
Similarly, if an argument is an interface (such as <class-factory> or <LPDISPATCH>) you must call AddRef on it if it will be kept for use after the call returns, and later call Release when finished with it.