VB6 or VB.Net?

Ways of telling in the code.

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • 4

51 Replies - 55958 Views - Last Post: 05 April 2013 - 02:58 AM Rate Topic: -----

#16 eyes_angel  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 01-April 09

Re: VB6 or VB.Net?

Posted 04 April 2009 - 02:57 AM

View Postfirebolt, on 4 Apr, 2009 - 12:53 AM, said:

Great document which has the differences.

Attachment attachment
hi i want to kno if i hv to make a simple graphical interface to control the industrial system then which is better VB6 or VB .Net?i know VB .Net is gud ,having more features but wats good in VB6.i want to make it in Vb6 and want to kno y VB6.i m choosing VB6 as i hv learnt dis language and dont kno VB.Net.pls help me .reply sonn pls....
Was This Post Helpful? 0
  • +
  • -

#17 firebolt  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 92
  • View blog
  • Posts: 5,561
  • Joined: 20-February 09

Re: VB6 or VB.Net?

Posted 04 April 2009 - 03:00 AM

vb6 is easier to understand and use by a factor of 4 compared to VB.NET but i muset agree, VB.NET had much better and more features than VB6
Was This Post Helpful? 0
  • +
  • -

#18 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1639
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: VB6 or VB.Net?

Posted 04 April 2009 - 09:42 AM

View Postmailderemi, on 27 Jan, 2009 - 09:55 PM, said:

VB6 or VB.Net?
I am using VB for about 10 years... tested VB.Net 2003,2005,2008 and 2010 (beta)...
I think one of the FULL BUG program is Visual Studio .Net . Of course VS2008 is one of the bests but because of those bugs I prefer VB6...

I don't know if I put a link here, admin user makes me banded or...
This shows how powerful is VB6 !!


I'm not understanding what you're saying. What bugs are you referring to? And if you've truly been using VB for 10 years you would know just how powerful VB (not VB.NET) is not. VB6 (and older) were good for rapid deployment, and for new programmers to cut their teeth with, but it really never had a place with the real programming languages simply because of it's lack of functionality and power
Was This Post Helpful? 0
  • +
  • -

#19 firebolt  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 92
  • View blog
  • Posts: 5,561
  • Joined: 20-February 09

Re: VB6 or VB.Net?

Posted 05 April 2009 - 05:33 AM

whats a full bug program??
haha 300th post. how ironic!

This post has been edited by firebolt: 05 April 2009 - 05:34 AM

Was This Post Helpful? 0
  • +
  • -

#20 eyes_angel  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 01-April 09

Re: VB6 or VB.Net?

Posted 05 April 2009 - 07:21 AM

View Postfirebolt, on 4 Apr, 2009 - 02:00 AM, said:

vb6 is easier to understand and use by a factor of 4 compared to VB.NET but i muset agree, VB.NET had much better and more features than VB6

yup vb .net is better but it is true only wen i need to use its all features.i want to know wen i m going to design a simple interface then y i should choose vb .net y nt vb6 wen it is simple to use and understand.pls reply if u hv proper ans, y to go wid vb6 while designing a simple interface.
Was This Post Helpful? 0
  • +
  • -

#21 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1639
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: VB6 or VB.Net?

Posted 05 April 2009 - 09:38 AM

@eyes_angel You should choose VB.NET over VB6 for many reasons, like VB6 is a dieing language not supported by Microsoft anymore, VB.NET is easier to use, more powerful, object orientated, an dis an all around better language.

VB6 is like a kids toy (always has been always will be), but I don't understanding the statement that it's "easier to understand" than VB.NET, that statement baffles me. I've been using VB since VB3 and let me tell you I avoid it like the plague (knowing how to use it and actually using it are two different stories).

Trust me, if you want to be a programmer continue learning the .Net world as VB6 will get you nowhere :)
Was This Post Helpful? 0
  • +
  • -

#22 firebolt  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 92
  • View blog
  • Posts: 5,561
  • Joined: 20-February 09

Re: VB6 or VB.Net?

Posted 06 April 2009 - 05:58 AM

Agreed. Dunno why my school is still using VB6.
Was This Post Helpful? 0
  • +
  • -

#23 searockruz  Icon User is offline

  • D.I.C Regular

Reputation: 24
  • View blog
  • Posts: 460
  • Joined: 07-March 09

Re: VB6 or VB.Net?

Posted 06 April 2009 - 06:12 AM

vb 6 is light vb.net is heavy in term of computer resources
Was This Post Helpful? 0
  • +
  • -

#24 firebolt  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 92
  • View blog
  • Posts: 5,561
  • Joined: 20-February 09

Re: VB6 or VB.Net?

Posted 06 April 2009 - 06:16 AM

Also agreed.
Was This Post Helpful? 0
  • +
  • -

#25 paperclipmuffin  Icon User is offline

  • Disassembling...
  • member icon

Reputation: 13
  • View blog
  • Posts: 944
  • Joined: 16-April 09

Re: VB6 or VB.Net?

Posted 08 May 2009 - 11:43 PM

The only reason I use VB 6.0 is my dad had a copy of it from back in the ark, when it first came out. :)
Was This Post Helpful? 0
  • +
  • -

#26 DocRabbit  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 09-May 09

Re: VB6 or VB.Net?

Posted 09 May 2009 - 03:58 AM

View Posteyes_angel, on 5 Apr, 2009 - 06:21 AM, said:

View Postfirebolt, on 4 Apr, 2009 - 02:00 AM, said:

vb6 is easier to understand and use by a factor of 4 compared to VB.NET but i muset agree, VB.NET had much better and more features than VB6

yup vb .net is better but it is true only wen i need to use its all features.i want to know wen i m going to design a simple interface then y i should choose vb .net y nt vb6 wen it is simple to use and understand.pls reply if u hv proper ans, y to go wid vb6 while designing a simple interface.

If it can be done in vb6, has all the functionality you need for now and every more (rarely ever seen this occur at time of writing a program), produces no bugs what-so-ever, then yes I would use vb6 over VBNet.

Been programming since the only windows you saw were the ones on your office wall and c:\>_ was your only screen companion. In all my years of programming, have yet to ever have one single program to pass all the criteria I stated above. So, in other words, even if it is going to be a plain simple ferrari, its still better than a chevette.(Sorry GM, but even you guys would admit this)
Was This Post Helpful? 0
  • +
  • -

#27 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: VB6 or VB.Net?

Posted 19 May 2009 - 05:33 PM

View Posteyes_angel, on 5 Apr, 2009 - 06:21 AM, said:

View Postfirebolt, on 4 Apr, 2009 - 02:00 AM, said:

vb6 is easier to understand and use by a factor of 4 compared to VB.NET but i muset agree, VB.NET had much better and more features than VB6

yup vb .net is better but it is true only wen i need to use its all features.i want to know wen i m going to design a simple interface then y i should choose vb .net y nt vb6 wen it is simple to use and understand.pls reply if u hv proper ans, y to go wid vb6 while designing a simple interface.


You might keep in mind that VB6 skills aren't very marketable anymore, whereas VB.Net skills are much more so.
Was This Post Helpful? 0
  • +
  • -

#28 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: VB6 or VB.Net?

Posted 19 May 2009 - 05:58 PM

View PostPsychoCoder, on 5 Apr, 2009 - 08:38 AM, said:

VB6 is like a kids toy (always has been always will be


Here's an example of some code that suggests that VB6 is rather more than a kids' toy. For those interested, it allows customization of the fonts in the MsgBox function. I might add that such a thing is much easier to do in VB.Net, so one could make as strong a case that VB.Net is a kids' toy, too, given its ease of use when you start going deep. I prefer to simply say that both are viable means of meeting serious business requirements.

I have a point for saying this, and I'm not off the topic of the thread. VB6 isn't going to die any time soon! It's going to coexist with VB.Net for quite a while. There are plenty of legacy VB6 applications around, some that are quite sophisticiated (QED), that are running quite well as is. As such, it's unlikely that initiatives on the part of the VB6-is-a-toy pundits to dismantle VB6 applications and rewrite them in .Net will go very far, once the subject of money is broached.

On the other hand, most new software is being written in .Net or Java. So, if you want to make your skills marketable, gain experience in C#, really. We have a whole new set of pundits who believe that C# is more sophsiticated than VB.Net, and one might as well go with the flow of ego. Better yet, learn both. Best of all, learn the .Net framework, because that's where all the functionality is. After a few years, everyone will figure this out, even HR people, and it will be what you need to know.

Bob

'This code allows font changes and various other format customizations of the standard VB6 MsgBox dialog box.  It
'uses CBT hooking to intercept a MsgBox call, then gets a handle to the MsgBox window as well as its various child 
'windows (the label containing the message text, any buttons, and an icon if it exists).  It then resizes the 'window to accommodate the message text and other windows, and repositions the icon and any command buttons.  
'Finally, it positions the msgbox window in the center of the screen.

'General Note: notes are above the line of code to which they apply.

Option Explicit

' Window size and position constants
Private Const ICON_WIDTH As Integer = 32
Private Const BTN_WIDTH As Integer = 75
Private Const BTN_HEIGHT As Integer = 23
Private Const BTN_SPACER As Integer = 6	' Space between 2 buttons
Private Const STW_OFFSET As Integer = 12   ' Standard window offset, minimum distance one window can be from
										   ' the edge of its container
										   
' SendMessage constants that we will use
Private Const WM_SETFONT = &H30
Private Const WM_GETTEXT = &HD

' Necessary constants  for hooking
Private Const HCBT_CREATEWND = 3
Private Const HCBT_ACTIVATE = 5
Private Const WH_CBT = 5

' Working variables that require global scope in hooking module
Private hHook As Long
Private myFont As IFont
Private cPrompt As String
Private hwndStatic As Long
Private ButtonHandles() As Long
Private xPixels As Long
Private yPixels As Long
Private isIcon As Boolean

' The API declarations we need
Private Type SIZE
	cx As Long
	cy As Long
End Type

Private Type RECT
	Left As Long
	Top As Long
	Right As Long
	Bottom As Long
End Type

Private Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long
Private Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
'GETTEXT needs a String argument, SETFONT needs an Any argument, hence 2 declarations for SendMessage
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function SendMessageS Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Private Declare Function EnumChildWindows Lib "user32" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long

' Wrapper for the normal MsgBox function
Public Function myMsgBox(Prompt As String, Buttons As VbMsgBoxStyle, ByVal fSize As Integer, ByVal fBold As Boolean, ByVal fItalic As Boolean, ByVal fULine As Boolean, fFaceName As String, Optional Title As String, Optional HelpFile As String, Optional Context As Long, Optional x As Long, Optional y As Long) As Long
'x and y arguments are optional and are in twips.  If not specified, msgbox will use default window sizes
'and positions, which work fine if you are using default font sizes.  If you aren't they may not.
cPrompt = Prompt
Set myFont = New StdFont
myFont.SIZE = fSize ' We can play around with the font to our heart's content here, all in a VB-friendly way
myFont.Bold = fBold
myFont.Italic = fItalic
myFont.Underline = fULine
myFont.Name = fFaceName
'Convert x and y arguments to pixels from twips.  (Twips are the same size no matter what the screen
'resolution; pixels aren't.)
If Not IsMissing(x) Then
	xPixels = Int(x / Screen.TwipsPerPixelX)
End If
If Not IsMissing(y) Then
	yPixels = Int(y / Screen.TwipsPerPixelY)
End If
hHook = SetWindowsHookEx(WH_CBT, AddressOf CBTProc, App.hInstance, 0)
'This will call CBTProc, passing the handle of the MsgBox window to the wParam argument.
myMsgBox = MsgBox(Prompt, Buttons, Title, HelpFile, Context)
End Function

Private Function CBTProc(ByVal lMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Dim i As Integer
Dim statX As Integer   'X dimension of static (text) window
Dim statY As Integer   'Y dimension of same
Dim cLeft As Integer   'Current Left value for current button, used to position buttons along x axis
Dim rc As RECT		  'Used with GetClientRect
If lMsg = HCBT_ACTIVATE Then
	'Immediately unhook (we have the handle we're looking for, and don't want to fire any more CBT events)
	UnhookWindowsHookEx hHook
	'Call EnumChildWindowProc once for each window that is contained in the MsgBox
	EnumChildWindows wParam, AddressOf EnumChildWindowProc, 0
	'Reinitialize the static buttoncount variable, see the proc
	EnumChildWindowProc 0, 1
	'Should always be true, but this prevents an abend if for some reason we fail to get the text window
	If hwndStatic Then
		'If the x parameter has been supplied to the main wrapper, then xPixels <> 0
		If xPixels Then
			With Screen
				'Center the MsgBox window in the screen
				SetWindowPos wParam, 0, (.Width / .TwipsPerPixelX - xPixels) / 2, _
							(.Height / .TwipsPerPixelY - yPixels) / 2, xPixels, yPixels, 0
			End With
			'Analogous to the ScaleWidth and ScaleHeight properties.  Client rectangle's dimensions are
			'returned to the rc type and exclude the dimensions of the title bar and the borders.
			GetClientRect wParam, rc
			'Calculate x and y values for text window.  If there's an icon, we need to reduce the size of the
			'text window by the width of the icon plus a standard offset value.
			statX = rc.Right - rc.Left - STW_OFFSET * 2 - ((isIcon And 1) * (ICON_WIDTH + STW_OFFSET))
			statY = rc.Bottom - rc.Top - BTN_HEIGHT - STW_OFFSET * 2
			'We need to position the text window along the x axis such that it's a standard offset from the left
			'border of the msgbox, plus the width of the icon and another standard offset if the icon exists.
			SetWindowPos hwndStatic, 0, STW_OFFSET + (isIcon And 1) * (ICON_WIDTH + STW_OFFSET), STW_OFFSET, statX, statY, 0
			isIcon = 0
			'Loop through the button handles, calculating the left border position each time.
			For i = 0 To UBound(ButtonHandles)
				'Current left border is half the container window's width, less the width of half the total
				'number of buttons, plus the offset of the current button in the array.
				cLeft = Int(xPixels / 2 + BTN_WIDTH * (i - (UBound(ButtonHandles) + 1) / 2))
				'Modify the above to add button spacer widths.
				cLeft = cLeft + BTN_SPACER * (i - (UBound(ButtonHandles) - 1) + (UBound(ButtonHandles) Mod 2) / 2)
				'The Y value is 1 standard offset more than the height of the text window.
				SetWindowPos ButtonHandles(i), 0, cLeft, statY + STW_OFFSET, BTN_WIDTH, BTN_HEIGHT, 0
			Next
		End If
		SendMessage hwndStatic, WM_SETFONT, myFont.hFont, True
	End If
End If
CBTProc = 0 ' allow operation to continue
End Function

Private Function EnumChildWindowProc(ByVal hChild As Long, ByVal lParam As Long) As Long
Static ButtonCount As Integer
Dim sLen As Integer
Dim wClass As String
Dim wText As String
Dim rc As RECT
If lParam Then
	ButtonCount = 0	 'See the direct call of this proc in CBTProc: resets the ButtonCount variable to 0
	Exit Function
End If
wClass = String(64, 0)
'look up the type of the current window
sLen = GetClassName(hChild, wClass, 63)
wClass = Left(wClass, sLen)
'We have either one or two static windows: optionally the icon (the first window if it's there) and the
'text window (analogous to a label control).
If wClass = "Static" Then
	'If we already have the text window's handle, we don't need to do this anymore.
	If Not hwndStatic Then
		'Find out if the current window's text value is the same as the text passed in to the cPrompt
		'argument in the main wrapper function.  If it is, it's the text window and we store the handle
		'value in hwndStatic.  If it isn't, then it's an icon and we set the isIcon flag.
		wText = String(Len(cPrompt) + 1, 0)
		sLen = SendMessageS(hChild, WM_GETTEXT, 255, wText)
		wText = Left(wText, sLen)
		If wText = cPrompt Then
			hwndStatic = hChild
		Else
			isIcon = True
		End If
	End If
ElseIf wClass = "Button" Then
	'Store the button's handle in the ButtonHandles array
	ReDim Preserve ButtonHandles(ButtonCount)
	ButtonHandles(ButtonCount) = hChild
	ButtonCount = ButtonCount + 1
End If
EnumChildWindowProc = 1  ' Continue enumeration
End Function





View Postfirebolt, on 6 Apr, 2009 - 04:58 AM, said:

Agreed. Dunno why my school is still using VB6.


Cheaper. :)
Was This Post Helpful? 0
  • +
  • -

#29 AdscendJeremy  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 18
  • Joined: 23-May 09

Re: VB6 or VB.Net?

Posted 26 May 2009 - 08:09 PM

VB6 for life ;)
Seriously I don't see any good reason to change to .NET. Maybe for specific types of applications, but VB6 is much easier to use and you can use API calls to do just about anything you want. The .NET code documentation is a nightmare, trying to sort through all of the different namespaces to find the function you're looking for. I used .NET for a couple of apps, and I haven't touched it since. Granted I'm also moving away from VB also and not doing much programming anymore, but switching to .NET reminds me of the opposite experience I had of switching from Perl to PHP. VB6 is like PHP and .NET is like Perl. (Meaning only that VB6 is much easier to work with ;))
Was This Post Helpful? 0
  • +
  • -

#30 Masspwr  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 27-May 09

Re: VB6 or VB.Net?

Posted 28 May 2009 - 04:46 AM

Hi.
Well I have used both of these. But I am not really into vb.
However my friends are vb nuts. I ask them what one is better
Vb6 or .net
They use vb6. They all say vb6
I ask why but they kind of say
Because it is
And never give a proper answer.
What is the differences?
Why is which one better.
Was This Post Helpful? 0
  • +
  • -

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • 4