I have an plain-old asp web site that makes a call to a method in a dll written in VB 6. This method sets an error code in the VB Err Object if something goes wrong. Now I want to access that error code and description set in the Err object from a javascript (where I do the call to the dll method). First: is it possible? Second: if it is possible, how can I do that? Thanks in advance!
我有一个普通的asp网站,它调用用VB 6编写的dll中的方法。如果出现问题,这个方法在VB Err对象中设置一个错误代码。现在我想从javascript(我调用dll方法)中访问Err对象中设置的错误代码和描述。第一:有可能吗?第二:如果有可能,我该怎么做?提前致谢!
My first idea was:
我的第一个想法是:
Function MyFunc()
{
var obj = Server.CreateObject(“MyDll.MyClass”);
try
{
obj.MyMethod();
}
catch(error)
{
// Here I want to get the error code and description from the VB Err object
}
}
However, when I try this, the error I get is wrong. (I tried to make a test-app which receives the same error.) I get an error-code which isn't the same in JavaScript as in VB.
但是,当我尝试这个时,我得到的错误是错误的。 (我尝试制作一个接收相同错误的测试应用程序。)我得到的错误代码在JavaScript中与在VB中不一样。
Anyone know how this aught to be done?
任何人都知道如何做到这一点?
/L
1 个解决方案
#1
1
In your MyClass, add a property that holds the error info when an error event occurs, then you should be able to look at obj.MyErrorCode and find out what you need.
在MyClass中,添加一个在发生错误事件时保存错误信息的属性,然后您应该能够查看obj.MyErrorCode并找出所需内容。
#1
1
In your MyClass, add a property that holds the error info when an error event occurs, then you should be able to look at obj.MyErrorCode and find out what you need.
在MyClass中,添加一个在发生错误事件时保存错误信息的属性,然后您应该能够查看obj.MyErrorCode并找出所需内容。