I just transferred an app from one computer to another and upgraded from VS 2002 to VS 2005. After doing this, I'm getting several errors, the most common one being: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). The error occurs on the line that says InitializeComponent() at the end of the region "Window Form Designer generated code" for one of my forms. I looked at my classes in the Class View window, and they appear the same as those on my other machine w/ VS 2002. What do I need to do to register this class

Class not registered
AndyJ_PS
Code is pasted below. One other question. I see in the online help there's supposed to be an option for stepping through "Just My Code." If I could disable this option, maybe I can step through the InitializeComponent routine But I can't seem to find this option. I click Tools|Options and don't see any options for debugging.
' <System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmCommSet))
Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
Me.SSTab1 = New System.Windows.Forms.TabControl()
Me._SSTab1_TabPage0 = New System.Windows.Forms.TabPage()
Me.lblError = New System.Windows.Forms.Label()
Me.lblSerial = New System.Windows.Forms.Label()
Me.cmdFindDisto = New System.Windows.Forms.Button()
Me.lblPort = New System.Windows.Forms.Label()
Me.lblStopBits = New System.Windows.Forms.Label()
Me.lblParity = New System.Windows.Forms.Label()
Me.lblDataBits = New System.Windows.Forms.Label()
Me.lblBaud = New System.Windows.Forms.Label()
Me.cboBaud = New System.Windows.Forms.ComboBox()
Me.cboPort = New System.Windows.Forms.ComboBox()
Me.cboStopBits = New System.Windows.Forms.ComboBox()
Me.cboParity = New System.Windows.Forms.ComboBox()
Me.cboDataBits = New System.Windows.Forms.ComboBox()
Me.cmdSettingsHelp = New System.Windows.Forms.Button()
Me.cmdSettingsOK = New System.Windows.Forms.Button()
Me.MSComm1 = New AxMSCommLib.AxMSComm()
Me._SSTab1_TabPage1 = New System.Windows.Forms.TabPage()
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
Me.optCCW = New System.Windows.Forms.RadioButton()
Me.optCW = New System.Windows.Forms.RadioButton()
Me.lblWallHeight = New System.Windows.Forms.Label()
Me.lblWallThickness = New System.Windows.Forms.Label()
Me.cboWallHeight = New System.Windows.Forms.ComboBox()
Me.cboWallThickness = New System.Windows.Forms.ComboBox()
Me.Frame1 = New System.Windows.Forms.GroupBox()
Me.optCenter = New System.Windows.Forms.RadioButton()
Me.optLeft = New System.Windows.Forms.RadioButton()
Me.optRight = New System.Windows.Forms.RadioButton()
Me.Image3 = New System.Windows.Forms.PictureBox()
Me.Image2 = New System.Windows.Forms.PictureBox()
Me.Image1 = New System.Windows.Forms.PictureBox()
Me.cmdWallSettingsOK = New System.Windows.Forms.Button()
Me.cmdWallHelp = New System.Windows.Forms.Button()
Me._SSTab1_TabPage3 = New System.Windows.Forms.TabPage()
Me.Label4 = New System.Windows.Forms.Label()
Me.cboWindowWidth = New System.Windows.Forms.ComboBox()
Me.Label3 = New System.Windows.Forms.Label()
Me.cboWindowHeight = New System.Windows.Forms.ComboBox()
Me.Label2 = New System.Windows.Forms.Label()
Me.cboSillHeight = New System.Windows.Forms.ComboBox()
Me.cmdWindowSettings = New System.Windows.Forms.Button()
Me.Label1 = New System.Windows.Forms.Label()
Me.cboFrameDepth = New System.Windows.Forms.ComboBox()
Me._SSTab1_TabPage2 = New System.Windows.Forms.TabPage()
Me.txtACADUnits = New System.Windows.Forms.TextBox()
Me.cdlgCommSet = New AxMSComDlg.AxCommonDialog()
Me.SSTab1.SuspendLayout()
Me._SSTab1_TabPage0.SuspendLayout()
CType(Me.MSComm1, System.ComponentModel.ISupportInitialize).BeginInit()
Me._SSTab1_TabPage1.SuspendLayout()
Me.GroupBox1.SuspendLayout()
Me.Frame1.SuspendLayout()
Me._SSTab1_TabPage3.SuspendLayout()
Me._SSTab1_TabPage2.SuspendLayout()
CType(Me.cdlgCommSet, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
chilakaluri
Maybe I'm not commenting the line out correctly. When I step through the entire program, it still jumps to the exception handler when it hits the InitializeComponent() line. I have the breakpoint set on the line immediately after the line I commented out, as follows:
'<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent() ' here's where I put the breakpoint...
But it never gets to this line. It jumps to the exception handler when it hits the InitializeComponent() line in the #Region "Windows Form Designer generated code" as follows:
#Region "Windows Form Designer generated code"
Public Sub New()
...
InitializeComponent() ' here's where I get the error.
Form_Initialize_renamed()
Steve Thornton
My guess is that there is some ActiveX which was supported with VS2002 and now is no longer. Maybe you find and replace just that single one, so that you can keep the upgraded project.
So I would like you to step into not over InitializeComponent. Are you sure that the function you set the breakpoint in is the InitializeComponent function belonging to that form The name of the file should be similar to the file name of the form definition.
--
SvenC
Deicide
Step into InitializeComponents of the form giving you that problem.
What line is executed when the error message comes up
--
SvenC
me&#42;
It must be ActiveX components not registered problems. You have to identify what activex components you have used for that Form and run "regsvr32.exe" to registered again. For example, you know that Form contains ms flexgrid, you need to run "regsvr32.exe C:\windows\system32\msflxgrd.ocx" to register this component, do not confuse with interop.xxx.dll, there is nothing to do with it.
If you have an installer for your vb6 program, that would be more easier to solve this problem. you just need to run the installer. Everything will be registered for you :)
Novice in C&#35;
You should be able to debug into that code when you change these settings:
Click the "Show all files" button in Solution Explorer. This should give you sub entries for your form. Open the .designer.vb file
Comment out the line
<System.Diagnostics.DebuggerStepThrough()> _
right before InitializeComponent. Set a breakpoint in that function and single step it. Where does the error occur
--
SvenC
dron747
Does the error come up when you use VS2005 or when you run your app
--
SvenC
osamaT
Hi,
Tools->Options->Debugging->General : Enable just my code
I have that active and can break and step into InitializeComponent, so I guess that is not the problem.
There are two controls which might be problematic or need some of the vb6 common controls:
Me.MSComm1 = New AxMSCommLib.AxMSComm()
and
Me.cdlgCommSet = New AxMSComDlg.AxCommonDialog()
Can you remove them and the following BeginInit() calls on them and see how far you get.
You could also try to add System.Diagnostics.Debug.WriteLine("1"); and "2" and "3" and so on to get those numbers in the output window of VS, so you can see how far the code executes. Place one right at the beginning of InitializeComponent.
--
SvenC
coco250
Too bad, that would have been my exact steps. Could you paste the complete code of the InitializeComponent method. Maybe someone sees a control which is a suspect.
--
SvenC
Rei Miyasaka
A couple of clues:
I changed the debug setting to uncheck "Just My Code" and WAS able to step into the InitializeComponent routine. I found an error occurring on the tab control (SSTab1).
In the Errors List, I have two errors regarding the AxCommonDialog. They both say "AxCommonDialog is ambiguous in the namespace AxMSComDlg."
For either of the above, how do I fix these When I try to view the form containing the tab control (by clicking the Designer icon in Solution Explorer), I get a message that says "The designer cannot process the code at line 662: Me.cdlgCommSet.Enabled = True. The code within the method 'InitializeComonent' is generated by the designer and should not be modified. So I have not been able to "remove" the controls in question as you suggested.
Kamii47
Strange that that setting is different for me. But good that it is working now.
Just make a backup of the code in InitializeComponent so that you can roll it back. Uncomment line 662. BTW is that error from the designer new or could you not use the designer before, also I would replace the AxCommonDialog with the open & save dialogs of the framework OpenFileDialog and SaveFileDialog.
Changing the tab control may be a bit more work, depending how many specific features you use from sstab - but in the long run your project will profit.
--
SvenC
adi151478
Glyn Harper
The error occurs on the InitializeComponent () line below.
#Region "Windows Form Designer generated code "
Public Sub New()
MyBase.New()
If m_vb6FormDefInstance Is Nothing Then
If m_InitializingDefInstance Then
m_vb6FormDefInstance = Me
Else
Try
'For the start-up form, the first instance created is the default instance.
If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then
m_vb6FormDefInstance = Me
End If
Catch
End Try
End If
End If
'This call is required by the Windows Form Designer.
InitializeComponent()
Form_Initialize_renamed()
End Sub
Srilatha
When I click "Show all files," the only sub-entry I see for my form is one with an extension of .resX. I do not see anything called Designer.vb. I did a search for <System.Diagnostics.DebuggerStepThrough()> and found it in several locations. It is actually on the same line as the Private Sub InitializeComponent() statement, as follows.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent ()
I inserted a comment symbol ahead of the < and a breakpoint as you suggest. The error still occurs on the InitializeComponent() statement elsewhere in my program, so I am unable to step through the InitializeComponent sub.
Please note that this is a VB6 program that was upgraded to Visual Studio.NET 2002 and then upgraded to VS 2005. Could this have anything to do with it I must be missing something fundamental here.