Jscript & COM 
Author Message
 Jscript & COM

Hi,

I am using Jscript in my code.
I am calling an automation object and according to its
documentation; a certain method returns a DOMDocument (XML)

Public Function Execute(ByVal sURL As String, ByVal sMethod As String) As
DOMDocument

How do I process the return object in Jscript ?

Error Code follows:

var oClient = new ActiveXObject("Component.MyCode");
oXmlDom = oClient.Execute("http://foo","listPeople"); // still a variant
 WScript.Echo( oXmlDom.text ); // Code fails here!

Is there anyway to cast the variant back to its class or interface type
IXMLDOMDocument?

--
Regards,

Gavin Bong

Quote:
>> This way to your good health! <<

http://www.*-*-*.com/


Fri, 13 Dec 2002 03:00:00 GMT  
 Jscript & COM
howdy--

what do you get when you alert(typeof oXMLDom)  or alert(oXMLDom instanceof ActiveXObject) ?

T

Hi,

I am using Jscript in my code.
I am calling an automation object and according to its
documentation; a certain method returns a DOMDocument (XML)

Public Function Execute(ByVal sURL As String, ByVal sMethod As String) As
DOMDocument

How do I process the return object in Jscript ?

Error Code follows:

var oClient = new ActiveXObject("Component.MyCode");
oXmlDom = oClient.Execute("http://foo","listPeople"); // still a variant
 WScript.Echo( oXmlDom.text ); // Code fails here!

Is there anyway to cast the variant back to its class or interface type
IXMLDOMDocument?

--
Regards,

Gavin Bong

Quote:
>> This way to your good health! <<

http://members.xoom.com/agedashi/


Fri, 13 Dec 2002 03:00:00 GMT  
 Jscript & COM
howdy--

Well, to answer your "is there any way you can cast. . ."  not in js which has no formal anything/everything's a variant.   If your component is really doing what you're saying, and instanceOf is ActiveXObject, you should look at it in a de{*filter*}, make sure your parseError is empty, etc.

You never did say the error you are getting.

T

Hi T-man,

I got "object" from alert( typeof (oXmlDom) ).

--
Regards,

Gavin Bong

Quote:
>> This way to your good health! <<

http://www.*-*-*.com/


howdy--

what do you get when you alert(typeof oXMLDom)  or alert(oXMLDom instanceof
ActiveXObject) ?

T



Fri, 13 Dec 2002 03:00:00 GMT  
 Jscript & COM
Hi T-man,

I got "object" from alert( typeof (oXmlDom) ).

--
Regards,

Gavin Bong

Quote:
>> This way to your good health! <<

http://members.xoom.com/agedashi/


howdy--

what do you get when you alert(typeof oXMLDom)  or alert(oXMLDom instanceof
ActiveXObject) ?

T



Sat, 14 Dec 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. jscript & COM

2. VBScript, COM Events & Safe Arrays

3. Strings, VBScript & COM Objects

4. Error Handling using VBScript & COM

5. Strings, VBScript & COM Objects

6. C# IEnumerator & COM interop w/ WSH

7. Callbacks from COM objects in Jscript

8. Calling COM API from JScript !

9. Catching COM object errors in server-side jscript?

10. Using COM objects that return recordsets from JScript

11. JSCript and returning parameters from COM object

 

 
Powered by phpBB® Forum Software