Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call MTS methods

Status
Not open for further replies.

BML

Programmer
Oct 24, 2000
37
PT
Hi,

I have an VB application that calls MTS methods (written with VC++).

Now I have to migrate the clients from VB to HTML, but the calls to the MTS components don't work, the out parameters always return indefined.

An practical example:

VC++ method:
Code:
HRESULT getName(/*[in]*/long cust_id, /*[out]*/BSTR *Name,/*[out]*/BSTR *msgErr, /*[out, retval]*/long res);
JavaScript call to MTS method:
Code:
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function xpto()
{
  var cust_id = 1000;
  var Name = String(&quot;&quot;);
  var msgErro = String(&quot;&quot;);
  
  var obj = new ActiveXObject(&quot;MyMTSComponent.MyClass&quot;);
  var Res = obj.getName(cust_id, Name, msgErro);

  alert(Name);
}
//-->
</SCRIPT>

The alert result is always: undefined

Why?

How can I get the Name parameter correctly?

regards,

Bruno Loureiro
<brunoloureiro@usa.net>
 
i would write a new function that returns the name, i'm almost sure that using out params doesn't change their values here (ie they are passed by value so changing them inside the function doesn't change them outside)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top