Main Topics
Browse All TopicsI have an OCX (developed by myself) to be used in a web page using javascript / vbscript.
I would like to pass a variable to the OCX and then change the value of the parameter inside the OCX and then pass the new value back to the JavaScript function. It would be great if the parameter can be of type string.
Is it possible to pass the address (pass by reference) of a javascript parameter to OCX.
thank you
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You should post your answer and request a moderator refund your points after accepting your own solution. If they deem your question truly was unaddressed, your points will be refunded.
However, your question requested changing a (preferably) string type by reference...which is not possible, last I heard. If you've got new information on this, do share. :)
If you passed a javascript object and changed a property inside the object, then that's really a different way of solving your problem but it is not a new answer to the question. :-P
Regards.
Thanks. Yes I wanted to pass a variable to an ActiveX control and then change the value of that variable inside the ActiveX control and then pass the new value back to JavaScript. What I have done now is to leave the parameter route and rather return a BSTR* from the ActiveX control function to the calling JavaScript function. So I don't think I am changing a property of the object.
Is this what you guys said I shoud I do?
Business Accounts
Answer for Membership
by: dbrittPosted on 2007-10-12 at 07:47:26ID: 20065851
No. All javascript parameters are by value only.
WScript users often have similar questions and the answer in WScript is that there is an alternate way to call a method such that the needed value is returned.
Good luck with your project!