Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using wrong version of VB?

Status
Not open for further replies.

damonh78

Programmer
Jul 28, 2005
44
IE
Hi,

I am a c++ programmer who has to debug some VB code as part of a certification I am doing, I understand and have written basic VB code but am a bit confused as to why the code I am trying to build wont work. This code definitely worked before so I am wondering is there any problem with the version of VB I am using (if that sort of problem exists).
I have inserted a snippet of the code below from a file called: frmlogger.frm.
The "Version 5#" (whenever you write in VERSION 5.00 it gets turned into 5#), the "Object =" line and all the "Begin VB." lines are all in red in the VB6 IDE when the form is loaded up. When I type in "Begin VB." the ide does not give me any of the options which are present in the code, ie VB.Form is not there.
When I try and run the code the first error I get is about the VERSION line, I am told its an invalid outside procedure (what does this line do anyway).

I am running Microsoft Visual Basic 6.0(SP3) on a Windows 2000 Machine.

There is probably (hopefully) some stupid reason for this, any help on this matter would be gratefully appreciated.

Thanks,

John

VERSION 5#
Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "SHDOCVW.DLL"
Begin VB.Form frmLogger
Caption = "Logger"
ClientHeight = 9450
ClientLeft = 5295
ClientTop = 1560
ClientWidth = 9600
ControlBox = 0 'False
LinkTopic = "Form1"
NegotiateMenus = 0 'False
ScaleHeight = 9450
ScaleWidth = 9600
Visible = 0 'False
Begin VB.CommandButton Refresh
Caption = "Refresh"
Height = 375
Left = 7920
TabIndex = 10
Top = 720
Width = 1215
End
Begin VB.CheckBox autorefresh
Caption = "AutoRefresh"
Height = 375
Left = 4560
TabIndex = 9
Top = 720
Width = 1335
End
Begin SHDocVwCtl.WebBrowser browser
Height = 4695
Left = 240
TabIndex = 8
Top = 1440
Width = 9015
ExtentX = 15901
ExtentY = 8281
ViewMode = 0
Offline = 0
Silent = 0
RegisterAsBrowser = 0
RegisterAsDropTarget = 1
AutoArrange = 0 'False
NoClientEdge = 0 'False
AlignLeft = 0 'False
ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
Location = "res://C:\WINNT\system32\shdoclc.dll/dnserror.htm# End
 
My apps written in VB 6 all have
VERSION 5.00
at the top of the form.

HTH

---- Andy
 
Yeah thats what it should have I know but the VB6 ide turns 5.00 into 5# whenever I type it in for some reason.
 
Don't type or copy-paste this code in VB IDE. The initial part of a VB form file contains information about the layout and properties of controls and form itself. This information is maintained by the form designer and cannot be viewed or edited as text in VB Edit window.

To reconstruct the form file again, do not use VB Edit window. Instead, close VB, open a Notepad window and paste all that above code in Notepad. After that save the text file as "frmlogger.frm".

When the .frm file is saved to disk, you can include it in your project or open it directly, as you wish. I tried the above VB code, with some small fixes and it worked fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top