将MSXML2.DOMDocument作为参数传递时,无效的过程调用或参数 [英] Invalid procedure call or argument while passing MSXML2.DOMDocument as argument

查看:381
本文介绍了将MSXML2.DOMDocument作为参数传递时,无效的过程调用或参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对此我需要一些帮助,因此非常紧急.我会尽快做出回应.我的经典ASP页面中有此代码

I need some help on this and it urgent. I will appriciate the quick response. I have this code in my classic asp page

dim objTestCOMLib
dim str1

dim objInputDOM 
Set objInputDOM = server.CreateObject("MSXML2.DOMDocument")
objInputDOM.async = false

objInputDOM.LoadXML(sx)

set objTestCOMLib = Server.CreateObject("ABCOMTest.COMClass1")
str1 = objTestCOMLib.ParseXMLDOM(objInputDOM)
Response.Write(str1)   
 
''and here is my dot net class library code  
Public Function ParseXMLDOM(ByVal objXML As MSXML2.DOMDocument) As String
Return objXML.xml
End Function 



当我运行应用程序时,出现此错误



when I run the application I get this eror

Error Type:
Microsoft VBScript runtime (0x800A0005)
Invalid procedure call or argument: ''ParseXMLDOM''
/TestWeb/Emp.asp, line 35


提前非常感谢.


Thanks very much in advance.

推荐答案

您确定该方法是通过COM公开的吗?您是否想到过,如果通过COM调用VB类,将更容易传递XML字符串并使用.NET DOM类进行解析?
Are you sure that the method is exposed via COM ? Did it occur to you that if you''re calling a VB class via COM, it would be easier to pass in your XML string and work with a .NET DOM class to parse it ?


感谢克里斯蒂安的答复.我还没有尝试过,您的建议是什么.我一定会尝试的.


只想说我如何做所有事情
我已将我的dot net dll命名为Strong,已添加到GAC中,并且还通过RegAsm注册.我在这里有一个疑问,我正在使用Interop.MSXML2.dll版本4.0.0.0,并且当我通过Server.CreateObject("MSXML2.DOMDocument")在Classic asp页面中创建对象时,我认为它会创建该版本的对象"C:\ WINXP \ System32".这是MSXML2版本2.6.0.0.可以是一个问题吗?


有两件事要提及

首先,我尝试创建我的点网Windows应用程序,并添加了Interop.MSXML2.dll的引用,该引用已被我的点网dll引用,可以正常工作.

其次,我尝试创建MSXML2版本2.6并对其进行互操作,并将其命名为Strong,并将其添加到GAC中.现在,我在点网dll中引用了此版本.我再次将dot net dll放入GAC,然后通过REgASM注册.

这次的错误是


错误类型:
(0x80070002)
/TestWeb/Emp.asp,第35行
Thanks for reply Christian. I have not tried yet, what you are suggesting. I will sure try this.


Just want to mention how am I doing everything
I have strong named my dot net dll , added to GAC and also registerd through RegAsm. I have one doubt here I am using Interop.MSXML2.dll version 4.0.0.0 and when I create an object in Classic asp page through Server.CreateObject("MSXML2.DOMDocument") then I think it creates object of the version which is in "C:\WINXP\System32". This is MSXML2 version 2.6.0.0. Can that be a problem.


there are two things that want to mention

First, I tried creating my dot net windows application and added the reference of the Interop.MSXML2.dll which is being referred by my dot net dll it works fine.

Second, I tried to create and Interop of the MSXML2 version 2.6 and strong named it and also added to GAC. Now I referenced this version in my dot net dll. I again put my dot net dll into GAC and then register through REgASM.

This time the error is


Error Type:
(0x80070002)
/TestWeb/Emp.asp, line 35


这篇关于将MSXML2.DOMDocument作为参数传递时,无效的过程调用或参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆