Hello all!

I have a huge headache over this issue so ill just get right into it, the clients just got new windows 7 pro machines, they were using windows xp machines with no issue with this custom vb app, heres the error that pops up when they try to bring up the payment form to make a payment for a customer:

PROBLEM BELOW:

An error occurred creating the form. See Exception.InnerException for details.  The error is: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

Source = System.Windows.Forms
StackTrace = " at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid) 
at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid) 
at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid) 
at System.Windows.Forms.AxHost.CreateInstance()     
at System.Windows.Forms.AxHost.GetOcxCreate() 
at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)     
at System.Windows.Forms.AxHost.CreateHandle() 
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) 
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) 
at System.Windows.Forms.AxHost.EndInit() 
at WaynokaCampground.frmMakePayment.InitializeComponent() 
in C:\Users\aj\Desktop\Waynoka Apps\Waynoka Campground\Waynoka Campground\MemberLookup\frmMakePayment.Designer.
vb:line 681 at WaynokaCampground.frmMakePayment..ctor() in C:\Users\aj\Desktop\Waynoka Apps\Waynoka Campground\Waynoka Campground\MemberLookup\frmMakePayment.vb:line 12"

PLEASE LET ME KNOW IF I NEED TO GIVE ANY MORE INFO ABOUT THE ERROR

On my dev machine I could only regenerate the error that was poppung up on the client machines when I changed the "Target CPU" to 'Any CPU' or 'x64'. This error does not pop up on my dev machine if the Target CPU is set to x86.
I figured I need to register something on the client machines but for the life of me I cannot figure out what to register, nor do I fully know how to register a DLL/COM file. Hopefully somebody out there is reading this and is laughing at this issue while they are typing out the solution because I am beyond frustrated. Thanks SO SO SO much for your time!

Recommended Answers

All 13 Replies

Are you using a custom DLL?

If So, you can try this.

If not - is it possible to post the code around Line 12 of the MakePayment form?

I'm thinking they don't have the correct version of the dotnet framework installed.

I highly doubt it has anything to do with the code as I have changed NOTHING as far as coding wise goes, but here is line 12:)
line 12:

Private PrintFont As New Font("Lucida Console", 10)

Line 681 has nothing to do with this issue I can promise you that, however, I can post the method in which the program calls when an employee clicks on the "Make Payment" button and the error pops up:

 Private Sub tsbWpoaPayment_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbWpoaPayment.Click

        ' ---------------------------------
        ' Security: Check for proper group permissions
        ' ---------------------------------
        If varEmpRwPayments = "N" Then
            MsgBox("Your employee group does not have permission " & vbNewLine & "to make payments.", MsgBoxStyle.Exclamation, "Error: Permission Denied")
            Exit Sub
        End If


        Dim item As ListViewItem
        Dim checkedItems As ListView.CheckedListViewItemCollection = ListWPOAInvoices.CheckedItems
        Dim i As Integer = 0
        Try
        *THE COMMENT BELOW IS WHERE THE ERROR POPS UP WHEN I DEBUG THE APP*
            With My.Forms.frmMakePayment
                .Show()
                .lbName.Text = Me.lbMemberName.Text
                .lbAccountID.Text = Me.lbAccountID.Text
                .lbPaymentType.Text = "WPOA"
                If lbInvWpoaSelectedAmount.Text.StartsWith("$") Then
                    'Positive
                    .txtPaymentTotal.Text = lbInvWpoaSelectedAmount.Text.Substring(1, Len(lbInvWpoaSelectedAmount.Text) - 1)
                    .txtPayingAmount.Text = lbInvWpoaSelectedAmount.Text.Substring(1, Len(lbInvWpoaSelectedAmount.Text) - 1)
                Else
                    'Negative
                    .txtPaymentTotal.Text = "-" & lbInvWpoaSelectedAmount.Text.Substring(2, Len(lbInvWpoaSelectedAmount.Text) - 3)
                    .txtPayingAmount.Text = "-" & lbInvWpoaSelectedAmount.Text.Substring(2, Len(lbInvWpoaSelectedAmount.Text) - 3)
                End If
                If Me.ListWPOAInvoices.CheckedItems.Count > 0 Then
                    For Each item In checkedItems
                        frmMakePayment.lvInvoices.Items.Add(ListWPOAInvoices.Items(checkedItems.Item(i).Index).SubItems(1).Text)
                        frmMakePayment.lvInvoices.Items(i).SubItems.Add(ListWPOAInvoices.Items(checkedItems.Item(i).Index).SubItems(7).Text)
                        i = i + 1
                    Next
                End If
            End With
        Catch ex As Exception
            If Len(ex.InnerException.Message.ToString) > 0 Then
                MsgBox("Error: Can not load payment form." & vbNewLine & ex.InnerException.Message.ToString)
            Else
                MsgBox("Error: Can not load payment form.")
            End If
        End Try

    End Sub

BTW, this app was built around the .NET Framework 2.0. On the new Windows 7 machines, .NET framework 4.0 is installed.

try changing the build to .net 4.0 and see if the error becomes clearer.

I cant change the build to 4.0 as this brings up a bunch of errors when I try to publish the vb app. Anyone else got any ideas? I have VS2010 installed on my machine, and the clients that are having this issue have x64 computers, just like mine. I however DO NOT get this error when I try to make a payment in our custom vb application. Im almost positive its a dll that is not getting registered but I have NEVER had to deal with this issue before in my life. Hopefully somebody can still help.

If this is a third party DLL, it is possible that it is not .NET 4.0 Compliant.

Is it possible to contact the designer of this dll?

Here is my 2 cents worth for something to check. You mention 64-bit repeatedly. Are you trying to target 64 bit? One of the DLL's may be 32-bit only. I believe that it would run fine under VS as VS is a 32-bit app.

The app cannot run in xp mode. The app does not install into a directory. I am not trying to target 64 bit eventhough most of the client machines are now 64 bit. However, on my machine I can run the program and bring up the payment form. WITHOUT Visual Studio:(

And I DO NOT KNOW what dll is missing or not registered. I do not know how to figure it out unfortunately:/

You could try installing Visual studio on one of the win 7 machines and see if it'll run your code. If so the compiled version from that machine will probably run. if not then, it should identify which library is at fault and needs updating.

Alternatively you can try using a setup and deploy project to create a setup package for your app. Then XP Mode might work.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.