|
-
Jul 19th, 2004, 01:26 PM
#1
Thread Starter
Fanatic Member
Is this VB6 to VB.NET code ok or can it be better?
After using the Upgrade Wizard, I obviously have a lot of things to fix. I used the wizard generated messages and came up with this for one of the PaintPicture problems. Would you folks take a look and see what you think? I am sure it could be done better.
Original VB6 code......
frmMyMain.PaintPicture frmMyMain.imgBackground.Picture, 0, 0, frmMyMain.ScaleWidth, frmMyMain.ScaleHeight
to VB.NET code.....
Dim gr As Graphics
gr.DrawImage(CType(frmMyMain, frmHorizontal).DefInstance.imgBackground.Image, 0, 0, CType(frmMyMain, frmHorizontal).DefInstance.imgBackground.Image.Width, CType(frmMyMain, frmHorizontal).DefInstance.imgBackground.Image.Height)
-
Jul 19th, 2004, 02:12 PM
#2
I wonder how many charact
To me it looks like you are simply putting a picture on the form, that stretches the entire length of the form?
VB Code:
MyForm1.BackGroundImage = myimage
You can set that remarkably easy in the VS Form Designer
-
Jul 19th, 2004, 02:50 PM
#3
PowerPoster
Another reason to not use the upgrade wizard
-
Jul 19th, 2004, 03:00 PM
#4
i have yet to find a reason TO use the upgrade wizard
-
Jul 19th, 2004, 03:14 PM
#5
Thread Starter
Fanatic Member
Please stay on topic guys. I already have a thread on the Upgrade Wizard. The bottom line is...I am going to use it. I have a 40,000 line VB6 project and despite all the negatives I have heard about the Upgrade Wizard, I have yet to have anyone give me any documenation or articles that confirm that it is junk. From what I have seen so far, it saves a tremendous amount of time by not have to recreate all your forms. In my case I have A LOT of forms. Yes, the code is pretty ratty, but it is a good guide to upgrading (re-writing) in VB.NET. No matter how you look at, a 40,000 line conversion is a monster job.
Anyway, by me (us) doing this we can give some good feedback on how it progresses. All support and help is appreciated.
Thanks!
-
Jul 19th, 2004, 03:31 PM
#6
Frenzied Member
Ugh, do yourself a huge favor and don't do it. You're going to end up with such a flakey, band-aided mess that has very little of the advantages of .NET. It may seem like this is the quicker way, but the costs in maintenance time and poor functionality down the road are going to come back and bite you.
Sean
Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.
-
Jul 19th, 2004, 03:48 PM
#7
I wonder how many charact
Yea... I would dread working on a .Net project that had been upgraded from VB6...
-
Jul 19th, 2004, 03:55 PM
#8
see im not alone
ANY book you pickup on moving from VB6 to .NET will tell you the same thing (which is why I told it to you) MS might not say it so loud since after all the upgrade wizard IS their program. How would you feel if you worked at MS and wrote that thing (which i am sure was no easy app) and then MS just tells everyone not to use it
If you HAVE to update it real fast and all that, then sure, use the upgrade wizard, but in your free time, work on writing it from scratch in .NET
Not only will the app be better, but you will learn a lot more about the language itself
-
Jul 19th, 2004, 04:13 PM
#9
Originally posted by birthjay
Please stay on topic guys. I already have a thread on the Upgrade Wizard. The bottom line is...I am going to use it. I have a 40,000 line VB6 project and despite all the negatives I have heard about the Upgrade Wizard, I have yet to have anyone give me any documenation or articles that confirm that it is junk. From what I have seen so far, it saves a tremendous amount of time by not have to recreate all your forms. In my case I have A LOT of forms. Yes, the code is pretty ratty, but it is a good guide to upgrading (re-writing) in VB.NET. No matter how you look at, a 40,000 line conversion is a monster job.
Anyway, by me (us) doing this we can give some good feedback on how it progresses. All support and help is appreciated.
Thanks!
You want difinitive proof? OK, how about this: I was at a conference a while ago, and they had the guys from Microsoft come out at talk about .NET. Now, these weren't sales people, or marketing either, these were the guys in the trenches who BUILT .NET. Even they admited that the upgrade wizard was all that it was craked up to be and was only provided as a stop gap for those who wanted it. It would only convert about 60% of the code properly, with the rest needing to be done by hand. they recommended if at all possible to stay away from it and do the upgrade yourself; it'll save you a lot of pain and you'ld get to learn VB.NET at the same time.
TG
-
Jul 19th, 2004, 04:32 PM
#10
yay gay
Yeah, I still CAN'T get it why if you having it workign in vb want it in vb.net
\m/  \m/
-
Jul 19th, 2004, 04:34 PM
#11
Fanatic Member
Originally posted by PT Exorcist
Yeah, I still CAN'T get it why if you having it workign in vb want it in vb.net
probably wants to start writing in vb.net instead and scrap vb6
you gotta admit vb.net has a much better interface for the development environment.
sometimes i wish they just couldn't do a proper vb7 without the .NET change! Just give us the .NET interface and put vb6 in it
-
Jul 19th, 2004, 05:47 PM
#12
PowerPoster
Originally posted by birthjay
Please stay on topic guys. I already have a thread on the Upgrade Wizard. The bottom line is...I am going to use it. I have a 40,000 line VB6 project and despite all the negatives I have heard about the Upgrade Wizard, I have yet to have anyone give me any documenation or articles that confirm that it is junk. From what I have seen so far, it saves a tremendous amount of time by not have to recreate all your forms. In my case I have A LOT of forms. Yes, the code is pretty ratty, but it is a good guide to upgrading (re-writing) in VB.NET. No matter how you look at, a 40,000 line conversion is a monster job.
Anyway, by me (us) doing this we can give some good feedback on how it progresses. All support and help is appreciated.
Thanks!
This is the topic...no matter how you look at it, this is the topic. You are using the upgrade wizard, and you are asking for documentation about it. Well, what about ALL of our documentation that we have provided on this forum for you. Do you really think that all the "Professional" developers here are lying to you?
You want more proof:
Upgrade Wizard:
Code:
Dim gr As Graphics
gr.DrawImage(CType(frmMyMain, frmHorizontal).DefInstance.imgBackground.Image, 0, 0, CType(frmMyMain, frmHorizontal).DefInstance.imgBackground.Image.Width, CType(frmMyMain, frmHorizontal).DefInstance.imgBackground.Image.Height)
By hand (really could have been done in the property window also):
Code:
MyForm1.BackGroundImage = myimage
-
Jul 19th, 2004, 08:12 PM
#13
Member
Upgrade wizard is as useful as a one legged man in an ass kicking contest.
-
Jul 19th, 2004, 09:52 PM
#14
LITHIA, sometimes i wish they just couldn't do a proper vb7 without the .NET change! Just give us the .NET interface and put vb6 in it"
I think they did, most code need not be changed, if you reference vb I read the phase out time for MS is about seven+ years.

#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()
End Sub
#Region "Upgrade Support "
Private Shared m_vb6FormDefInstance As frmMain
Private Shared m_InitializingDefInstance As Boolean
-
Jul 20th, 2004, 12:17 AM
#15
Originally posted by birthjay
despite all the negatives I have heard about the Upgrade Wizard, I have yet to have anyone give me any documenation or articles that confirm that it is junk.
Articles won't tell you **** about the upgrade wizard. They'll just tell you how to use it.
How about more: It's department policy that we never, ever, ever, ever use the upgrade wizard. No matter if we're running short on time, they'll work with us. But no upgrade wizard!
-
Jul 20th, 2004, 12:22 AM
#16
Read this thread from gotdotnet forums. Strangely, he's got 40000 lines of code too.
Read all the comments given there, and be sure to visit this link, if you're still adamant on using the wizard:
http://msdn.microsoft.com/vbasic/dow...r/default.aspx
-
Jul 20th, 2004, 01:13 AM
#17
-
Jul 20th, 2004, 01:17 AM
#18
-
Jul 20th, 2004, 07:12 AM
#19
Thread Starter
Fanatic Member
Thank you for all the opinions on the Upgrade Wizard.
The point I was trying to make in requesting "to stay on topic" is that I had already heard the "opinions" about the Upgrade Wizard. I do appreciate each and every opinion that was posted though.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|