在Win7 Ultimate 64bits中,VB6 32位应用程序在CreateObject上失败。 [英] VB6 32bits application fails on CreateObject in Win7 Ultimate 64bits.

查看:157
本文介绍了在Win7 Ultimate 64bits中,VB6 32位应用程序在CreateObject上失败。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有一个有趣的问题,我想跟你分享一下可能会出现什么问题。



使用的操作系统是Windows 7英文终极64位。用户帐户有管理员权限。



当我运行visual basic6 32位应用程序



vb6应用程序正在执行以下操作:



Hello Everyone,

I have a funny issue I would like to share with you to move a bit forward on what could be the problem.

The operation system used is Windows 7 english ultimate 64bits. The user account has admin right.

When I run a visual basic6 32 bits application

The vb6 application is doing the following:

<Client.exe>
Dim objAcquisition As Object
Private Sub btnCreate_Click()
    On Error Resume Next
    Dim strProgID As String
    
    strProgID = "DummyServer.Automation"
    
    Set objAcquisition = VBA.CreateObject(strProgID)
    
    If (objAcquisition Is Nothing) Then
        Label1 = "Cannot create " & strProgID & " => " & CStr(Err.Description)
    Else
        Label1 = "Create " & strProgID & " => completed"
    End If
    
End Sub





com activex exe也是在visual basic 32bits下开发的:





The com activex exe also developped under visual basic 32bits is:

<dummyserver.exe>
Private frm As Form1

Private Sub Class_Initialize()
    Set frm = New Form1
    
    Load frm
    frm.Show 0
End Sub





Form1只是一个小对话窗口,带有大标签文本Hello World



当我在开发计算机上运行客户端应用程序时,也在windows上运行7 pro 64bits电脑,工作正常。



当我想尝试Windows 7终极64位时,我收到错误需要对象



我已禁用UAC并关闭DEP但没有任何变化。

我确定这是一个计算机配置问题,但如何恢复它。 br />
我想知道Windows更新程序是否没有破坏它。



我还在该计算机上重新安装了vb6 redist软件包,但没有解决问题。



我也试过基于不同的论坛通过Speedy PC Pro工具恢复注册表ActiveX问题,但仍无法通过createobject启动acticeX exe。



我已经实现了一个小型Winform C#客户端,这很有效:



Form1 is just a small dialog window with a big label text "Hello World"

When I run the client application on my development computer and also on a windows 7 pro 64bits computer, it works fine.

When I want to try on a windows 7 ultimate 64 bits, I get the error "object required"

I have disabled the UAC and also turn DEP off but nothing changes.
I am sure this is a computer configuration issue but how to recover it.
I wonder if the windows updater has not broken it.

I have also re-installed the vb6 redist package on that computer but did not fix the issue.

I have tried also based on different forum to recover the registry ActiveX issue via the tool Speedy PC Pro but still impossible to launch the acticeX exe via createobject.

I have implemented a small Winform C# client and this works well:

private Type _VB6DocType = null;
private object _VB6Control = null;

private void button1_Click(object sender, EventArgs e)
{
    _VB6DocType = System.Type.GetTypeFromProgID("DummyServer.Automation");
    if (_VB6DocType == null)
    {
        label1.Text = "DummyServer.Automation = GetTypeFromProgID failed";
        return;
    }

    _VB6Control = System.Activator.CreateInstance(_VB6DocType);
    if (_VB6Control == null)
    {
        label1.Text = "DummyServer.Automation = CreateInstance failed";
        return;
    }

    label1.Text = "DummyServer.Automation = OK";
}





可能是什么问题?怎么可能修好它?



非常感谢你提前。

祝你好运。

MiQi。



What could be the problem ? How would it be possible to fix it ?

Thank you very much in advance.
Best regards.
MiQi.

推荐答案

我的vb6 activex exe也有同样的问题。



唯一的修复我发现只是以管理员身份启动托管应用程序一次。

然后,activex exe注册(显然)并且永远运行。



这就是我想要解决的问题



你修好了吗?



:Ron
I have the same problem with my vb6 activex exe.

The only "fix" I have found is to start the hosting application as administrator just once.
Then after that the activex exe is registered (apparently) and runs forevermore.

This is what i''m trying to fix

Did you fix yours?

:Ron


我修了我的!



MSCOMCT2.OCX存在,但默认情况下未在x64 SP1中注册



:Ron
I fixed mine!

MSCOMCT2.OCX exists but is not registered by default in x64 SP1

:Ron


这篇关于在Win7 Ultimate 64bits中,VB6 32位应用程序在CreateObject上失败。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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