GetObjectContext 在 VB6 COM dll 中不返回任何内容,从经典 ASP 调用

发布于 2024-10-30 21:56:55 字数 790 浏览 1 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦亿 2024-11-06 21:56:56

我知道这有点晚了,但我遇到了类似的问题,这为我解决了它:

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.

一曲琵琶半遮面シ 2024-11-06 21:56:56

我发现在 IIS 中使用 VB6 组件的 COM+ 方法有点不稳定。我将其添加到我想要在 ASP 中实例化的 VB6 类中::-

Private moScriptCtx As ScriptingContext

Public Sub OnStartPage(SC As ScriptingContext)

    Set moScriptCtx = SC

End Sub

您现在可以将请求、响应、服务器等作为 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::-

Private moScriptCtx As ScriptingContext

Public Sub OnStartPage(SC As ScriptingContext)

    Set moScriptCtx = SC

End Sub

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 the CreateObject execution.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文