Click here to Skip to main content
16,018,818 members
Please Sign up or sign in to vote.
3.67/5 (2 votes)
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.
Posted
Comments
[no name] 27-Nov-12 12:58pm    
I would change my error handling first before I report this as an outright bug, I woule like to see a try catch.
SuperMiQi 28-Nov-12 4:01am    
Hello Matlab,

What do you mean with 'try catch' in vb6, I use 'on error ...' and this returns me 'object required'. I am not using vb.net where I could indeed apply a try catch around my statements.

Best regards.
MiQi.
fjdiewornncalwe 27-Nov-12 14:18pm    
Are you sure you have the required vb6 runtimes installed in the target machine?
SuperMiQi 28-Nov-12 3:59am    
Hello Marcus,

I installed one more the required vb6 runtimes from http://support.microsoft.com/kb/192461/en-us but this did not fix it.

Any ideas are welcome.

Thank you.
Best regards.
MiQi.

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
 
Share this answer
 
I fixed mine!

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

:Ron
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



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