Need Visual Basic help with Visual Studio.NET - update VB Pro v6 worked

dullard

Elite Member
May 21, 2001
26,200
4,871
126
Thanks for telling me that .NET won't work. I've been tring to compile this during my research breaks for a few weeks now and it just gave tons of problems. VB v6 worked great (after I spent 10 minutes searching for a compile or build option - make isn't where I would have expected it). Now I just wish I had the MSDN CD to access the help files.

I should just come here for everything first.
 

chansen

Golden Member
Oct 9, 1999
1,133
0
71
You're gonna have issues compiling that with VB.NET. Much of the syntax has changed, as I understand.

Better off finding VB6 or whatever version you need than converting code over to .NET.

Craig
 

StageLeft

No Lifer
Sep 29, 2000
70,150
5
0
Unfortunately you can't really take those VB6 files and dump them into .NET the structure has changed so much that basically you have to re-write everything. Now since much of the old syntax is supported it doesn't mean starting from scratch - but as far as I know for the most part you'll want to create new files within a .net project and copy the code into them. I don't believe you can import a .vbp and whatever else you have your hands on.

If it's any help at all you can email me a .zip of all the VB6 files and as long as it's not a huge project i can compile it for you, but that's not much help unless you know it works and only need it compiled once ;)
 

NikPreviousAcct

No Lifer
Aug 15, 2000
52,763
1
0


<< compile is also known as build find the build button and push it >>

haha! :D Reading this was just hilarious for some reason. Don't mind me, I'm insane. But, yes, if you're going to use .NET, find "Build"
If you're going to use VB6, the compiler is one of the buttons in the top menus. Also, you can find it in the drop-down menus -I just can't remember which one. It's been about a year since I used VB6 and I can't remember.

nik
 

dullard

Elite Member
May 21, 2001
26,200
4,871
126
If it is too much trouble, I'll probably go and purchase a copy of VB instead. But since the thing is so small, the conversion hopefully won't be too much work. Here are the non-driver files. Do you think this will compile in .NET? Sorry about the long post this will make.

DOSINGLE.VBP:

Form=DOSINGLE.FRM
Module=DriverLINXLibrary; ..\LIB\DLVBLib.bas
Module=Module1; ..\..\..\dlocxapi\DLCODES.BAS
Module=DRVLNXVB; ..\..\..\dlocxapi\DRVLNXVB.BAS
Module=DriverLINXGUIInterface; ..\LIB\DLVBGui.bas
Object={4DE9E2A3-150F-11CF-8FBF-444553540000}#4.0#0; DLXOCX32.OCX
ProjWinSize=91,601,368,167
ProjWinShow=2
IconForm="DOSingleForm"
HelpFile=""
ExeName32="DOSingle.exe"
ExeName="AISVVB16.EXE"
Path="C:\WRKDRVLX"
Name="Project1"
HelpContextID="0"
StartMode=0
VersionCompatible32="0"
VersionCompatible="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="Scientific Software Tools, Inc."

DOSINGLE.FRM
VERSION 4.00
Begin VB.Form DOSingleForm
Caption = "Single Digital Output Value"
ClientHeight = 2190
ClientLeft = 2895
ClientTop = 2190
ClientWidth = 4065
Height = 2595
Left = 2835
LinkTopic = "Form1"
LockControls = -1 'True
ScaleHeight = 2190
ScaleWidth = 4065
Top = 1845
Width = 4185
Begin VB.TextBox txtWrite
Height = 288
Left = 240
TabIndex = 1
Text = " "
Top = 576
Width = 1308
End
Begin VB.CommandButton cmdWrite
Caption = "&Write"
Default = -1 'True
Height = 492
Left = 2400
TabIndex = 0
Top = 420
Width = 1332
End
Begin DlsrLib.DriverLINXLDD DriverLINXLDD1
Left = 3120
Top = 960
_Version = 262144
_ExtentX = 582
_ExtentY = 582
_StockProps = 64
_Version = 262144
_ExtentX = 582
_ExtentY = 582
_StockProps = 64
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "Status "
Height = 192
Left = 240
TabIndex = 4
Top = 1440
Width = 480
End
Begin DlsrLib.DriverLINXSR DriverLINXSR1
Left = 2760
Top = 960
_Version = 262144
_ExtentX = 582
_ExtentY = 582
_StockProps = 64
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "Digital Output Value in Hex:"
Height = 384
Left = 240
TabIndex = 3
Top = 96
Width = 1332
WordWrap = -1 'True
End
Begin VB.Label lblStatus
BackColor = &H00FFFFFF&
BorderStyle = 1 'Fixed Single
Height = 312
Left = 240
TabIndex = 2
Top = 1752
Width = 3492
End
End
Attribute VB_Name = "DOSingleForm"
Attribute VB_Creatable = False
Attribute VB_Exposed = False

Option Explicit

Const LogicalDevice As Integer = 0 'DriverLINX Logical Device
Const LogicalChannel As Integer = 0 'DriverLINX Logical Channel
Const ChannelGain As Single = -1# 'Gain setting for Logical Channel
Const BackGroundForeGround As Integer = 0 'IRQ or DMA = 1, Polled = 0


Private Sub Form_Load()

Dim DLDriverName As String
Dim DLResultCode As Integer
Dim DLMessage As String

txtWrite.Text = "&h0"

CenterForm Me

DLDriverName = OpenDriverLINXDriver(DriverLINXSR1, "", True)
If DLDriverName = "" Then
MsgBox "DriverLINX driver not opened.", vbOKOnly, Me.Name
End
End If

DLResultCode = InitializeDriverLINXDevice(DriverLINXSR1, LogicalDevice)
If DLResultCode <> DL_NoErr Then
ShowDriverLINXStatus DriverLINXSR1
End
End If

If Not HasDriverLINXSubsystem(DriverLINXSR1, DriverLINXLDD1, DL_DO) Then
MsgBox "This device does not support digital output.", vbOKOnly, Me.Name
End
End If

GetDriverLINXStatus DriverLINXSR1, DLMessage
lblStatus.Caption = DLMessage

SetupDriverLINXSingleValueIO DriverLINXSR1, DriverLINXLDD1, LogicalDevice, DL_DO, LogicalChannel, ChannelGain, BackGroundForeGround

End Sub


Private Sub cmdWrite_Click()

Dim DLMessage As String
Dim DLResultCode As Integer
Dim user As Integer
Dim WriteValue As Integer

WriteValue = Val(txtWrite.Text) 'if value is hex enter as &hA for 10
If IsInDriverLINXDigitalRange(DriverLINXSR1, DriverLINXLDD1, DL_DO, WriteValue, LogicalChannel) Then
DriverLINXSR1.Res_Sta_ioValue = WriteValue

Else
user = MsgBox("Value Out of Range", vbOKOnly, "Warning!")
txtWrite.Text = "0" 'clear erroneous value
lblStatus.Caption = "Error"
Exit Sub 'leave sub
End If

DriverLINXSR1.Refresh
DLResultCode = GetDriverLINXStatus(DriverLINXSR1, DLMessage)
lblStatus.Caption = DLMessage

End Sub


Private Sub Form_Terminate()
End 'terminate the program
End Sub

Private Sub Form_Unload(Cancel As Integer)

CloseDriverLINXDriver DriverLINXSR1

End Sub
 

dullard

Elite Member
May 21, 2001
26,200
4,871
126


<<

<< Do you think this will compile in .NET? >>



No.
>>



Thanks for the info. I have a two other options for purchase ($6 each):
Visual Basic Pro v5
Visual Basic Pro v6

Would either of these compile it? If so, which should I use?
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0


<< Thanks for the info. I have a two other options for purchase ($6 each):
Visual Basic Pro v5
Visual Basic Pro v6

Would either of these compile it? If so, which should I use?
>>



Get the latest version you can possibly get. Certain useful functions that are in the VB6 runtime are not in the VB5 runtime, like Split(), Join(), etc.