GetObjectContext 在 VB6 COM dll 中不返回任何内容,从经典 ASP 调用
我正在使用 VB6 IDE 调试此 Active X dll。我可以看到执行一直到尝试 GetObjectContext。此方法始终不返回任何内容。
这种情况发生在 Windows 7 32 位、IIS 7 上。(该应用程序在其他位置工作,其中之一是带有 IIS 7 的 Windows Server 2008)
我在 Google 上进行了广泛搜索,发现了许多与 COM+ 相关的参考资料,但没有COM+涉及到我的场景。只是来自注册 dll 的普通旧 Server.CreateObject。
我的 ASP 代码如下
SET objCalendar = Server.CreateObject("SSYSDEV.Calendar")
objCalendar.BuildCalendar("ADMINUSERS")
SET objCalendar = Nothing
DLL 中请求的函数的问题行是:
Dim objHttpRequest As ASPTypeLibrary.Request
Set objHttpRequest = GetObjectContext.Item("Request")
一如既往,我们将不胜感激任何帮助或建议。
我仍然无法克服必须使用 VB6 工作的震惊 - 我从未想过会发生这种情况!这就像被拖回到黑暗时代,以一种非常粗糙的方式引起水泡!
PS 我还设置了一个 COM+ 组件,并让 ASP 以这种方式获取对象,在本例中 GetObjectContext 返回一个空对象,其中没有 ASP 对象。所以这没有帮助:-(
I am debugging this Active X dll using the VB6 IDE. I can see the execution get as far as an attempt to GetObjectContext. This method always returns NOTHING.
This is happening on Windows 7 32 bit, IIS 7. (The application is working in other locations, one of which is Windows Server 2008 with IIS 7)
I have Googled extensively and found many references to this relating to COM+, but there is NO COM+ involved in my scenario. Just plain old Server.CreateObject from a registered dll.
I have ASP code as follows
SET objCalendar = Server.CreateObject("SSYSDEV.Calendar")
objCalendar.BuildCalendar("ADMINUSERS")
SET objCalendar = Nothing
The problem lines of the requested function in the dll are:
Dim objHttpRequest As ASPTypeLibrary.Request
Set objHttpRequest = GetObjectContext.Item("Request")
Any help or suggestions, as always, will be greatly appreciated.
I'm still getting over the shock of having to work with VB6 - I never thought it would happen! It's like being dragged back to the dark ages, in a very rough fashion that's causing blisters!
P.S. I have also set up a COM+ component and had the ASP get the object that way, GetObjectContext returns an empty object in this case, which has no ASP objects in it. So this is no help :-(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道这有点晚了,但我遇到了类似的问题,这为我解决了它:
Thread: Problem accessing Request object via COM+
http://forums.iis.net/t/1146404.aspx
摘要:在 COM+ 组件中启用“允许 IIS 固有属性”。
I know this is a little late, but I had a similar problem and this solved it for me:
Thread: Problem accessing Request object via COM+
http://forums.iis.net/t/1146404.aspx
Summary: turn on 'Allow IIS Intrinsic Properties' in the COM+ component.
我发现在 IIS 中使用 VB6 组件的 COM+ 方法有点不稳定。我将其添加到我想要在 ASP 中实例化的 VB6 类中::-
您现在可以将请求、响应、服务器等作为
moScriptCtx
对象的属性进行访问。您可能想知道如何调用
OnStartPage
。在CreateObject
执行期间,ASP 不会自动为您执行此操作。I've found that the COM+ approach to using VB6 components in IIS to be a bit flaky. I add this to a VB6 class that I want to instance in ASP::-
You can now access Request,Response,Server etc as properties of the
moScriptCtx
object.You might be wondering how you call
OnStartPage
in the first place. You don't ASP automagically does that for you during theCreateObject
execution.