Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Stephens' Visual Basic Programming 24-Hour Trainer
This is the forum to discuss the Wrox book Stephens' Visual Basic Programming 24-Hour Trainer by Rod Stephens; ISBN: 978-0-470-94335-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Stephens' Visual Basic Programming 24-Hour Trainer section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 16th, 2011, 10:22 AM
Authorized User
Points: 90, Level: 1
Points: 90, Level: 1 Points: 90, Level: 1 Points: 90, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 24
Thanks: 6
Thanked 0 Times in 0 Posts
Default Question on conversion

I was wondering if you know why Visual Studio opens an app and says "preparing solution", then finishes up with no other message, and the app seems to run fine? This happens with some practice code taken from on pc to another pc where the source pc runs the pro version and the destination pc is running Express. Maybe a better question would be...when opening a project done in VB.NET 2008 and opening it in VB.NET 2010 and letting the Visual Studio fix or convert it, isn't that a permanent fix if saved?

One other note, I have had some time to get started with the book and video's and the video's have kept me glued to the screen. Great job. I have learned that one should not skip the first few chapters thinking it's old news because they are coming from VB Classic. I initially jumped around in the video's but stopped and started from chapter 1 and will view them all. When I see things that are new I grab the book and research more on the info taken from the video. I have learned new stuff even in the first chapter. I think the compiler gets confused sometimes in your video's because you type so fast it can't keep up! Did you ever figure out why the compiler will cause you to have to start over yet?

Thanks,
DB

Last edited by Davebert; December 16th, 2011 at 10:39 AM..
Reply With Quote
  #2 (permalink)  
Old December 16th, 2011, 02:16 PM
Rod Stephens's Avatar
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Quote:
I was wondering if you know why Visual Studio opens an app and says "preparing solution", then finishes up with no other message, and the app seems to run fine? ... Maybe a better question would be...when opening a project done in VB.NET 2008 and opening it in VB.NET 2010 and letting the Visual Studio fix or convert it, isn't that a permanent fix if saved?
You could try to re-open the project in VB 2008 and see if VB 2010 has made it unopenable. If not, then it might be bending over backwards to maintain compatibility. (I don't know offhand if it does.) It's possible that this is causing the message.

If that's not it, then it may be some sort of configuration issue that you'll probably never figure out. This definitely falls into the category of "if it works don't worry about it." People who try to fix this sort of issue sometimes need to reinstall Visual Studio and rarely the whole system to get rid of essentially harmless messages. (If they don't go insane first. )

Quote:
One other note, I have had some time to get started with the book and video's and the video's have kept me glued to the screen. Great job. I have learned that one should not skip the first few chapters thinking it's old news because they are coming from VB Classic. I initially jumped around in the video's but stopped and started from chapter 1 and will view them all. When I see things that are new I grab the book and research more on the info taken from the video. I have learned new stuff even in the first chapter. I think the compiler gets confused sometimes in your video's because you type so fast it can't keep up! Did you ever figure out why the compiler will cause you to have to start over yet?
I found it quite hard to strike a balance in the videos between talking and typing. I normally type much faster than I do in the videos and I use IntelliSense a lot to generate a lot of code much faster than you could reasonably watch and figure out what I'm doing.

There are a few places where if I didn't do things in the proper order Visual Studio got confused. I blame some of that on it being an early release of that version of Visual Studio. It may have been fixed but I haven't tried to go back and reproduce everything to see if the problems are still there.

Normally Visual Studio doesn't get confused just because I'm going fast. It gets confused because I add something, delete it, and there's some piece left over somewhere in some automatically generated code that later confuses things. Fortunately those occasions are fairly uncommon so it's not usually a huge problem.

BUT here are a couple of tips:
  1. Save your work often. Every time you run a program, Visual Studio automatically saves it so you're okay of you test things once in a while. If you're typing a huge block of code, save manually once in a while.
  2. Save a backup before you make major or risky changes. If you're about to restructure a program, use Windows Explorer to save a copy of the whole project tree just in case. Then if you mess things up too badly, you can get the old version back. You can always delete the unneeded version later. (In many big projects I make a new copy every day just to be safe, and I often make one or more other copies during the day when I'm about to do something confusing.)
  3. Finally once in a while the form editor just gets really messed up. Not too often. In those cases you can either edit the automatically-generated code by hand (which takes some practice) or you can start over. It's worth peeking inside those files once in a while to see how they work just in case, but I'm definitely not too proud to start over on a small program!
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
Reply With Quote
The Following User Says Thank You to Rod Stephens For This Useful Post:
Davebert (December 18th, 2011)
  #3 (permalink)  
Old December 17th, 2011, 11:23 AM
Authorized User
Points: 90, Level: 1
Points: 90, Level: 1 Points: 90, Level: 1 Points: 90, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 24
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Thanks for the response and the tips. I am an avid backup person so I have that covered. I was more concerned with the "unknown" but like you said, I will probably never figure it out. So, I guess I would just rewrite the code in the 2010 version and eliminate the "unknown" because that would drive me insane if it did in fact produce a bug later (or even if it didn't I might think it did when it was my own bug). And the intermittent crashes are always a possibility...

One other thing...yesterday I ended up with the biggest headache I have had in a long time and I think I figured out what may have caused it. I watched 20 video lessons on my wide screen 1920x1080 monitor and when the viewer is first opened, it is not full screen so I maximize it. The text looks a bit blurry but I figured it would be fine. Anyhow, just thought I would mention it in case it can be optimized in future videos or made for different screen sizes. I ended up connecting the video's through my PC this morning through the DLNA server and can watch the other 19 video's on my 55" HDTV nice and large and clear. Problem solved. :)
Thanks,
DB

Last edited by Davebert; December 17th, 2011 at 11:26 AM..
Reply With Quote
  #4 (permalink)  
Old December 17th, 2011, 12:02 PM
Rod Stephens's Avatar
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Quote:
So, I guess I would just rewrite the code in the 2010 version ...
Manual conversion isn't too hard. Open the old project and then create a new one in a separate instance of Visual Studio. Copy the form's size from the old program to the new one. Then copy and paste the controls from the old project to the new one.

Finally copy the code from the old program to the new one. You can usually open the code in the code editor and press Ctrl+A to select all of the code. Then press Ctrl+C to copy it all. Finish by pasting it all. VB (unlike C#) hooks event handlers up to controls by using a Handles clause in the code so they should all be hooked up and ready to go.

Post again and let us know if that removes the mystery message.

Quote:
The text looks a bit blurry but I figured it would be fine. Anyhow, just thought I would mention it in case it can be optimized in future videos or made for different screen sizes.
I'm not sure what options we have there. I made the initial videos and they turned out to be too big to fit on a DVD. I turned them over to a production group who reformatted and compressed them to fit. I don't really know what their options are.

I'll mention it but obviously the real solution is for everyone to get a 55" HDTV
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
Reply With Quote
The Following User Says Thank You to Rod Stephens For This Useful Post:
Davebert (December 18th, 2011)
  #5 (permalink)  
Old December 18th, 2011, 12:44 PM
Authorized User
Points: 90, Level: 1
Points: 90, Level: 1 Points: 90, Level: 1 Points: 90, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 24
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Rod Stephens View Post
Manual conversion isn't too hard. Open the old project and then create a new one in a separate instance of Visual Studio. Copy the form's size from the old program to the new one. Then copy and paste the controls from the old project to the new one.

Finally copy the code from the old program to the new one. You can usually open the code in the code editor and press Ctrl+A to select all of the code. Then press Ctrl+C to copy it all. Finish by pasting it all. VB (unlike C#) hooks event handlers up to controls by using a Handles clause in the code so they should all be hooked up and ready to go.

Post again and let us know if that removes the mystery message.
Thanks for the info on the copying of the project. I like the fact that VB hooks event handlers up to controls as that will make it easier to do. I ran into what may be the reason I am having trouble with the mystery message. The project I used as an example was what I thought was a simple example. When I tried what you described above I realized the example I was trying to copy has a resource file with a form background image and also has the minimize maximize and exit buttons covering up the stock ones. Are resource files the same between version 2008 and 2010? I found "Resourcer" and had a look and found the image used for the background. That may be the reason for the mystery message. I will try it again and see if I use a plain form but I got carried away looking for a resource editor etc...


Quote:
Originally Posted by Rod Stephens View Post
I'm not sure what options we have there. I made the initial videos and they turned out to be too big to fit on a DVD. I turned them over to a production group who reformatted and compressed them to fit. I don't really know what their options are.

I'll mention it but obviously the real solution is for everyone to get a 55" HDTV
Well my eyes aren't like they used to be so I am part to blame. I just realized it's time to finally go to the eye doctor instead of using cheap reading glasses. I need to make the jump from a 1.5 to a 2.0 magnification power and that will help for now. I was also glad to realize the video's were made as .MOV files as my HDTV TV doesn't do Flash. My headache is gone and I am ready to get back to work. The in-laws will be over for the holidays for a week so I will be off dealing with them.
Thanks,
DB
Reply With Quote
  #6 (permalink)  
Old December 18th, 2011, 05:07 PM
Rod Stephens's Avatar
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

I don't know if resources would cause that problem but it's worth a try.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
Reply With Quote
  #7 (permalink)  
Old December 19th, 2011, 10:53 AM
Authorized User
Points: 90, Level: 1
Points: 90, Level: 1 Points: 90, Level: 1 Points: 90, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 24
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Ok, more info on my test. I found a few things worth noting. When the app is converted from VS2008 to VS2010 it uses the .NET Framework 4. When I tried to copy the app by creating a new one mine was set at .NET Framework 4 Client Profile. I don't know if this matters but I assume for best results they should be the same. I was getting the 3 following errors with the above setup.

Message 1 Could not find schema information for the element 'supportedRuntime'. C:\Documents and Settings\Dave\my documents\visual studio 2010\Projects\WindowsApplication3\WindowsApplicati on3\app.config 23 11 WindowsApplication3

Message 2 Could not find schema information for the attribute 'version'. C:\Documents and Settings\Dave\my documents\visual studio 2010\Projects\WindowsApplication3\WindowsApplicati on3\app.config 23 28 WindowsApplication3

Message 3 Could not find schema information for the attribute 'sku'. C:\Documents and Settings\Dave\my documents\visual studio 2010\Projects\WindowsApplication3\WindowsApplicati on3\app.config 23 43 WindowsApplication3

So I started over and from scratch and made a new project and changed the compiler to .NET Framework 4 and if I try to run the app with just a form I get the same 3 but they are just noted as "Messages". I checked my pc and I have .NET 4.0.3319 in my Framework folder.

Added:
Error messages after I run the app again are:
Error 4 'Protected Overrides Sub Dispose(disposing As Boolean)' has multiple definitions with identical signatures. C:\Documents and Settings\Dave\my documents\visual studio 2010\Projects\WindowsApplication3\WindowsApplicati on3\Form1.Designer.vb 7 29 WindowsApplication3

Error 5 'Private Sub InitializeComponent()' has multiple definitions with identical signatures. C:\Documents and Settings\Dave\my documents\visual studio 2010\Projects\WindowsApplication3\WindowsApplicati on3\Form1.Designer.vb 24 17 WindowsApplication3

Error 6 'components' is already declared as 'Private components As System.ComponentModel.IContainer' in this class. C:\Documents and Settings\Dave\my documents\visual studio 2010\Projects\WindowsApplication3\WindowsApplicati on3\Form1.vb 37 13 WindowsApplication3

Maybe the test I am trying isn't as simple as I thought? I can send you the project in it's original form as it just a simple lottery picker from PSC.
Thanks,
DB

Last edited by Davebert; December 19th, 2011 at 11:12 AM..
Reply With Quote
  #8 (permalink)  
Old December 19th, 2011, 01:18 PM
Rod Stephens's Avatar
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Are you just copying your code and not the automatically generated code? The automatically generated code changes from version to version so this is the sort of error you might get if you try that.

If you copy and paste the controls on the form editor, it should generate new code for them in the newer format.

If this doesn't seem like the right track, send me the project (RodStephens@vb-helper.com) and I'll take a peek.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
Reply With Quote
  #9 (permalink)  
Old December 19th, 2011, 01:52 PM
Authorized User
Points: 90, Level: 1
Points: 90, Level: 1 Points: 90, Level: 1 Points: 90, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 24
Thanks: 6
Thanked 0 Times in 0 Posts
Default

I just created a form of the same size and copied the code from the original form to the new form. I sent you the original project so you have all the info. If it is not a good learning example I will just find a simpler one but you be the judge.
Thanks,
DB

edit: I just started the project from the beginning again and realized it was made in a version prior to VB2008. It converted to the VB2008 just fine though and the problem seems to come when trying to convert yet again to VB2010.

Last edited by Davebert; December 19th, 2011 at 02:07 PM..
Reply With Quote
  #10 (permalink)  
Old December 19th, 2011, 02:49 PM
Authorized User
Points: 90, Level: 1
Points: 90, Level: 1 Points: 90, Level: 1 Points: 90, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 24
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Well, I guess it must have been some kind of beginners problem or the way I went about it as I just started with the downloaded app from PSC and opened it with VS2010 and converted it and it works perfect. I must have tried to do a dual convert starting with VS2008 and then went to VS2010 and maybe that is where the problem occurred.

That said, which files do I need to be concerned with other than the project and resource files? Any others that I would need to edit manually like we used to in VB6?
Thanks,
DB

p.s. I better study some more.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT conversion question jastao XSLT 3 April 29th, 2008 09:09 PM
VB 2005 question, binary to text file conversion pitcher General .NET 0 September 24th, 2007 07:45 PM
Conversion Question dlandolin Access 2 July 30th, 2005 02:09 AM
vb6 to vb.net conversion question tomz VB.NET 2002/2003 Basics 2 January 28th, 2004 10:51 AM



All times are GMT -4. The time now is 12:07 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.