In my current project, I have successfully implemented an IDL for passing a string value from JavaScript to C++. The JavaScript code effectively passes a string value to the C++/COM object.
[id(1), helpstring("method DoSomething")] HRESULT DoSomething([in] BSTR otlToken);
Now, I have a requirement to add another method that will return a string to a JavaScript caller. In order to achieve this, I made the following addition to the IDL:
[id(3), helpstring("method GetValue")] HRESULT GetValue([out] BSTR *nicknames);
However, the developer working on the JavaScript side is encountering issues such as getting a message about the wrong number of arguments when trying to call the method or access it as a property.
My concern is whether JS requires a call by reference to retrieve this data, or if I should pass the one BSTR* param as [in,out].
What steps can be taken to make this functionality work? Specifically, how can we retrieve a string value from C++/IDL to a JavaScript caller?
I would appreciate guidance on what the IDL needs to look like and how the JavaScript code should be structured in order to achieve this desired outcome.