Click here to Skip to main content
15,867,594 members

VB6 32bits application fails on CreateObject in Win7 Ultimate 64bits.

SuperMiQi asked:

Open original thread
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:

VB
<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


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

VB
<dummyserver.exe>
Private frm As Form1

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


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:
C#
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";
}


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

Thank you very much in advance.
Best regards.
MiQi.
Tags: Visual Basic 6, Windows, Windows 7, 64 bit

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900