Posted 19 years ago by Mark Mickelsen
Avatar
I don't know if this belongs here or in the UIStudio support forum, but here goes. I just spent about 2 hours creating and populating pages for the wizard control that I put on a form, saving periodically as I should. A few minutes ago I had to reboot my computer, so I hit control-S to save everything, and shut down VS, once again saving when it asked to. Then I rebooted. When the system came back up, all my work seemed to be gone. The form looks just like it did when I saved last night, with a new wizard on it, undocked and with no pages added to it. If I look at the code, I can see most if not all of the indications of the work I did, but on the design view, there are no pages and none of the forms that I put there. Does anyone know what's going on? Obviously, this is unacceptable. HELP!
Thanks,
Mark

Comments (12)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Mark, make a backup copy first. Then let's look at the code. You see all the pages there? Without seeing any of it myself, it sounds like you might be missing the line of code that adds the pages to the Wizard control. Can you see if that is in there?

Also what version are you running? I know we had an issue with page serialization in the Wizard control back before 3.0.0104 that was fixed with that release. This problem did not occur with the WizardDialogForm. This could be the same thing if you are running an old version.


Actipro Software Support

Posted 19 years ago by Mark Mickelsen
Avatar
First, I don't know how to tell what version we're running. Please tell me how.
Second, I ran a little experiment. I added a new user form to my project. I placed a wizard on the form, hit ctrl-s, got out of VS, opened VS again, and the wizard was still on the form. I set the dock param. to full so that the wizard was the same size as the form, hit ctrl-s, got out of VS, opened VS again, and the wizard was back to its original size and the dock param. said "none". It wasn't saved. I went into the code to see what I could see, and when I went back to the design view, the wizard was gone. Something very strange is going on.
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Look at the properties of your Wizard reference in your project. That tells you the version. Also what operating system and VS.NET do you run?


Actipro Software Support

Posted 19 years ago by Mark Mickelsen
Avatar
We appear to be running 3.0.0106. I'm XP Pro with SP2 and VS 2003.
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I don't understand. I followed exactly the steps you said in your experiment and I had no problems at all. The Wizard docked fine and I was able to even add pages, controls to pages, and they all persisted as they should. We also have a lot of customers running on these builds and nobody has mentioned any issues with persisting changes after we fixed that one problem before build 104.

Can you email us a new small sample project that reproduces the issue? Make sure to include the steps. It's working as expected here so that would help.

Are you using any other third-party controls or objects in your project or on the form? I'm wondering if one of those could be blowing up during code serialization causing the wizard code never to serialize.


Actipro Software Support

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Also you never said whether there was a Wizard.Pages.Add or AddRange call in the code for your project that you worked on. If you want to email us the code for that form, we can look for you.


Actipro Software Support

Posted 19 years ago by Mark Mickelsen
Avatar
This is not acting consistantly. Now, if I save after every 3 or 4 operations, it seems to working right. This is frustrating. I feel like the boy who cried "wolf". But, I really did lose about 2 hours of work earlier today.
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Like I said, if you email us your Form from this morning, we can look at it. The stuff might be there but just missing a statement to get it working.

[Modified at 05/25/2005 04:14 PM]


Actipro Software Support

Posted 19 years ago by Mark Mickelsen
Avatar
Here I am again with the same problem, only this time I saw something. I had two very nicely defined inner pages that I had put hours of work into. I had saved them frequently and knew that I could come back and they would be there. I could switch back and forth between them just fine. I had all of the properties and events defined and most of them coded. I began to write the main code for the functionality of the object when suddenly some sort of compile started. The error window opened up at the bottom of the screen and messages started scrolling up. And almost faster than I could see, all of the forms that I had placed on the wizard pages disappeared. The inner pages disappeared, and what was left was the original user control form with the raw wizard on it, not even docked to fill up the whole form. I looked on the code page and all the code that either I or the wizard generated seems to be there. There just doesn't seem to be anything to make it show up any more. I can send you the "after" code, and I suppose I can get the "before" code off of last night's backup. There would be few changes to it. What do you think?
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
When you do your coding, do you leave the designer view open while you write the code for the form? If so, that is NOT recommended. The VS.NET designer does a lot of quirky things and I would recommend always working on the code view and designer view separately, never at the same time.

Yes please email the code over. When the code serialization for the designer fails, VS.NET tends not to do it gracefully. Instead Microsoft just fails the code writing and doesn't give you an easy way to restore it.

Nevertheless, you might have everything there and just be missing a line or two to tie it together but I can't tell you unless I see it.


Actipro Software Support

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
As a follow up, you replied in email that you did have both code and design views open at the same time.

In the future, avoid that like the plague. Just work on one, then save, and work on the other. From what I'm seeing in your code file you sent, I'm thinking that since you had a code error, some sort of interaction with the VS.NET designer happened and it wasn't able to complete code generation so all the code that adds child controls to their parents is gone.

Most of your controls appear to be in place codewise. You can see by looking at InitializeComponent where VS.NET choked during code generation. Note that the first 10 or so controls didn't end up getting all their code generated while all the controls after that worked ok. The first 10 or so you'll have to set up again, but for the others, you're just missing the line to add them to their parent wizard page.

For the Wizard control, add these two lines:
this.wizEmployeeUI.Pages.Add(this.wizEmployeeUI);
this.wizEmployeeUI.Pages.Add(this.wizManagerGreeting);
For the two wizard pages, you're going to have to reconstruct the Controls.AddRange call that is normally there. That will be a little time consuming because you'll have to figure out what child controls were on each page. However it appears like the location and size and other properties of the child controls are in tact. So it's just a matter of adding back in the Controls.AddRange calls.

We have seen this sort of issue even when developing applications that don't use any third-party controls like ours. It's one of the things that you learn about after it's too late unfortunately. A lot of times when VS.NET code generation fails, it does it quietly and you don't find out until you try to run your app.

We've run in into it a lot when using UserControls and placing them on Forms. Sometimes the code for the UserControl in InitializeComponent just disappears for no reason.

Hope this helps!


Actipro Software Support

Posted 19 years ago by Mark Mickelsen
Avatar
Thanks for the analysis, but I'm not going to do anything because I just remembered something. I spent a lot of money and time setting up a system of nightly backups. Thank heaven! I got things back to last night's level in about 5 minutes, and ended up losing only about 15 minutes that is took to redo what I had added tonight (I had already done the thinking, you see, so it didn't take nearly as long to put it in again). I've learned a rough lesson, but it is learned now, and it won't happen again. Thanks.
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.