Recently made an ATL-based control, designed an interface, want to return multiple parameters, but through JavaScript but can not get the return value, originally thought is the problem of their own interface, and later found on the Internet a lot to find that the original MSDN has a clear saying:
JavaScript does not support passing parameters by reference. JavaScript would make copies of these variables and pass them by value when calling methods then take By-reference paramete Rs. Thus, you cannot get a return value via a method parameter when using JavaScript.
--------------------------------------------------------------------------------------------------------------- -----------
Interface definition
[id], helpstring ("Method Getaxisbaseinfo")] HRESULT Getaxisbaseinfo (BSTR uuid_bstr, LONG obj_id, short index, [out] bstr* name, "Out" bstr* type, [out] double* start, [out] Double* end, [out] double* step, [out] double* substep, [out] long* precision);
Expected to return multiple parameters, in JS does not work.
JavaScript and ATL COM return value issues