Results 1 to 6 of 6

Thread: Moved my VB6 upgrade project to a new machine and cannot open forms in designer

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2013
    Posts
    134

    Moved my VB6 upgrade project to a new machine and cannot open forms in designer

    Hi!

    I moved my VB6 to VB.NET upgrade project to a new machine. I can compile the application (with many warnings), but I cannot open some forms in the Designer. It says:
    Code:
    To prevent possible data loss before loading the designer, the following errors must be resolved: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
    And the first Call stack says:
    Code:
    1.   Hide Call Stack 
     
    at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
    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.set_Site(ISite value)
    at System.ComponentModel.Container.Add(IComponent component, String name)
    at System.ComponentModel.Design.DesignerHost.PerformAdd(IComponent component, String name)
    at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)
    at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeInstance(IDesignerSerializationManager manager, Type type, Object[] parameters, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.ComponentCodeDomSerializer.DeserializeInstance(IDesignerSerializationManager manager, Type type, Object[] parameters, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
    at System.ComponentModel.Design.Serialization.CodeDomSerializer.DeserializeStatementToInstance(IDesignerSerializationManager manager, CodeStatement statement)
    at System.ComponentModel.Design.Serialization.CodeDomSerializer.Deserialize(IDesignerSerializationManager manager, Object codeObject)
    at System.Windows.Forms.Design.ControlCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, Object codeObject)
    at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.DeserializeName(IDesignerSerializationManager manager, String name, CodeStatementCollection statements)
    At first I suspected the cause to be in "grid As AxDDSharpGridOLEDB2U.AxSGGrid", because this is the only visual element that differs from the forms which I can open. But even commenting out every use of this grid in the form.Designer.vb file kept the Call Stack from above. In the Error List those errors are listed as Messages and the referenced line ir 0 and column is 0.
    While there are still many warnings in the error list, I believe the Designer cannot open the form due to some other issue, because no other of the warnings refers to the form.Desiger.vb file.

    I get this problem on two machines, one Win 8 with VB Express 2008 and the other with Win 7 and VB Express 2012. Tomorrow I will try to comment out step by step everything on the form, maybe this will reveal the problem.

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,383

    Re: Moved my VB6 upgrade project to a new machine and cannot open forms in designer

    What many people will suggest for you to do is to start a fresh new .net project. Trying to copy and paste your outdated code will just cause more headaches than anything.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  3. #3
    Fanatic Member
    Join Date
    Feb 2013
    Posts
    985

    Re: Moved my VB6 upgrade project to a new machine and cannot open forms in designer

    what i would do, and have many times is, recreate the forms from scratch,

    if you import old projects or change frameworks or other influences on your project half way through the project, it doesnt tend to handle it that well and you end up with missing forms, weird exceptions regarding references to forms and controls and objects.

    it really doesnt make sense until you realize this analogy

    you gave birth to a human and after 1 year of development you changed its dna to that of a dog, do you think the partially developed body will like the sudden task of turning into a dog.

    weird analogy i know but i think thats what it boils down to.
    Yes!!!
    Working from home is so much better than working in an office...
    Nothing can beat the combined stress of getting your work done on time whilst
    1. one toddler keeps pressing your AVR's power button
    2. one baby keeps crying for milk
    3. one child keeps running in and out of the house screaming and shouting
    4. one wife keeps nagging you to stop playing on the pc and do some real work.. house chores
    5. working at 1 O'clock in the morning because nobody is awake at that time
    6. being grossly underpaid for all your hard work


  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Apr 2013
    Posts
    134

    Re: Moved my VB6 upgrade project to a new machine and cannot open forms in designer

    Of course, in the end all forms will consist only of the new corresponding .NET elements. But I want to make the changes incremental, not in one step. Why would the same form load in VB 2008 Express on the XP machine and not in the VB 2008 Express(exactly the same version) on the new machine. BTW the project has run through the VB 2008 Express upgrade wizzard before I started to upgrade anything.
    Ok, but I get the point, I will try to recreate the form, so that no old code stays somewhere hidden in the form.

  5. #5
    Fanatic Member
    Join Date
    Feb 2013
    Posts
    985

    Re: Moved my VB6 upgrade project to a new machine and cannot open forms in designer

    how many time did you try and change it.

    i ask because the time when this usually happens to me is after the second time i load it after its been changed.

    for example im switched projects from VS2008 to VS2010 with no problem until after i save it and try and load it again the second time, thats when all the forms disapear, the code is still there but there is no forms,

    people say go through the assembly files etc etc which to me is so tedious, what i do everytime now is just create a newproject, recreate all the forms and copy paste all the code back into the project.
    NOTE: dont copy paste the events or handlers let VS create them and then just copy paste the code inside them.

    it seams long windedbut from my experience saves my hours of researching what is actually happening sincenobody seems to know. i think like i said before VS automatically creates refernces and automatically adds hundreds of lines of code to projects, so if you just change something that VS misses its going to cause a problem that will take forever to fix, since it could be 1 of a million things that caused it.
    Yes!!!
    Working from home is so much better than working in an office...
    Nothing can beat the combined stress of getting your work done on time whilst
    1. one toddler keeps pressing your AVR's power button
    2. one baby keeps crying for milk
    3. one child keeps running in and out of the house screaming and shouting
    4. one wife keeps nagging you to stop playing on the pc and do some real work.. house chores
    5. working at 1 O'clock in the morning because nobody is awake at that time
    6. being grossly underpaid for all your hard work


  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Apr 2013
    Posts
    134

    Re: Moved my VB6 upgrade project to a new machine and cannot open forms in designer

    @GBeats

    Thank you for your comment.
    First I opened the old project in VS2008 and used the upgrade wizzard to import the code. After that I could open the forms without any problem.
    Then I worked on the project for a few days, and then I copied the project folder to my new pc with the same version of VS2008.
    Then on the new pc some of the Forms open with this kind of errors.
    Then I copied the VS2008 project folder to another pc with VS2012 installed, and opened the project there, but the errors are the "same" (I have not checked if they are really identical, but the errors show up when opening the forms in Designer, although you can compile the project.

    I will not get more into this problem, I am now working on the upgrade of the main form, then I will probably test your suggestion, to copy the code but recreate the design in a new form right away with the new elements. This will take longer to the first test compile, as then I have to upgrade the whole code first, but this way I will not have to solve those kind of problems.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width