Jump to content
yakuZza22

Transformare din VB6 in VB 2008 HELP!!!

Recommended Posts

Cum pot transforma din un cod sursa din vb 6 la cel de 2008 ...pt ca vad ca imi da multe erori...cand se fac unele schimbari.....imi mai trebuie ceva in plus???..decat ce are vb 2008....plz help....vreau sa imi lansez shi eu niste chestii aici....shi imi face numai probleme

50346650ty4.jpg

Asta e un binder la care lucrez....incerc multe pe el.....e facut de mine...shi folosesc multe "imprumutate" din themida shi de la alte bindere...cu el am eu probleme

Si asta e RATu pe care ....incerc sa it termin...dar tot dau de probleme...dar o sa il rezolv eu....eu zic ca o sa iasa unu chiar misto...o sa vedeti :)

32078182rl5.th.jpg81611234fi5.th.jpg10214107sk8.th.jpg77145261jf4.th.jpg28788512km4.th.jpg64060717vl4.th.jpg59010111ue9.th.jpg27562142ti3.th.jpg98190912oz5.th.jpg

Link to comment
Share on other sites

pai vezi tu ....uite un exemplu......isi shimba din visual basic 6 o comanda......iar in visual basic 2008 comanda respectiva nu o mai recunoaste...ini arata posibilitati de a schimba dar stiu ca nu sunt alea....shi faza e ca nu sunt nuci asa de avansat incat sa refac intregul cod sau sa schimb aceea comanda cu un intreg set de comenzi care sa ii tina locul ........

un exemplu.....am incercat sa tranform codul sursa al lui Bifrost 1.12 din VB6 shi apar o groaza de in cel din 2008....apar o groaza de erori poate imi trebuiec power packuri diferite....poate alte baze de date...nu stiu

Link to comment
Share on other sites

nu iau cu copy paste.....pur shi simplu schimb codurile si le modific pt vb 2008....dar unele nu sunt cele care ar trebui sau vb 2008 nu le recunoste uite exemplu Error 1 'ListView1' is not a member of 'ZylomBinDer.Zylom'.

Me.Enabled = False

Me.Cursor = System.Windows.Forms.Cursors.WaitCursor

With Me.ListView1.Items.Add(CommonDialogOpen.FileName)

'UPGRADE_WARNING: Lower bound of collection Me.ListView1.ListItems.Add() has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'

'UPGRADE_WARNING: CommonDialog property CommonDialog.FileTitle was upgraded to CommonDialog.FileName which has a new behavior. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="DFCDE711-9694-47D7-9C50-45A99CD8E91E"'

If Me.ListView1.Items.Add(CommonDialogOpen.FileName).SubItems.Count > 1 Then

Me.ListView1.Items.Add(CommonDialogOpen.FileName).SubItems(1).Text = CommonDialogOpen.FileName

Else

Me.ListView1.Items.Add(CommonDialogOpen.FileName).SubItems.Insert(1, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, CommonDialogOpen.FileName))

End If

'UPGRADE_WARNING: Lower bound of collection Me.ListView1.ListItems.Add( , , CommonDialog.FileName) has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'

If Me.ListView1.Items.Add(CommonDialogOpen.FileName).SubItems.Count > 2 Then

Me.ListView1.Items.Add(CommonDialogOpen.FileName).SubItems(2).Text = CStr(FileLen(CommonDialogOpen.FileName))

Else

Me.ListView1.Items.Add(CommonDialogOpen.FileName).SubItems.Insert(2, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, CStr(FileLen(CommonDialogOpen.FileName))))

End If

'UPGRADE_WARNING: Lower bound of collection Me.ListView1.ListItems.Add() has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'

If Me.ListView1.Items.Add(CommonDialogOpen.FileName).SubItems.Count > 3 Then

Me.ListView1.Items.Add(CommonDialogOpen.FileName).SubItems(3).Text = "1"

Else

Me.ListView1.Items.Add(CommonDialogOpen.FileName).SubItems.Insert(3, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, "1"))

End If

'UPGRADE_WARNING: Lower bound of collection Me.ListView1.ListItems.Add() has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'

If Me.ListView1.Items.Add(CommonDialogOpen.FileName).SubItems.Count > 4 Then

Me.ListView1.Items.Add(CommonDialogOpen.FileName).SubItems(4).Text = "T"

Else

Me.ListView1.Items.Add(CommonDialogOpen.FileName).SubItems.Insert(4, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing, "T"))

End If

End With

Link to comment
Share on other sites

uite sursa poti sa faci ceva?

Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"

Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"

Begin VB.Form Form1

BorderStyle = 1 'Fixed Single

ClientHeight = 6465

ClientLeft = 45

ClientTop = 330

ClientWidth = 9990

Icon = "Binder-Form1.frx":0000

LinkTopic = "Form1"

MaxButton = 0 'False

MinButton = 0 'False

ScaleHeight = 6465

ScaleWidth = 9990

StartUpPosition = 2 'CenterScreen

Begin VB.Frame Frame2

Height = 3255

Left = 240

TabIndex = 13

Top = 240

Width = 7335

Begin VB.CommandButton Command4

Caption = "OK"

Height = 255

Left = 3000

TabIndex = 14

Top = 1800

Width = 1335

End

Begin VB.Label Label4

BeginProperty Font

Name = "Courier New"

Size = 18

Charset = 0

Weight = 700

Underline = 0 'False

Italic = 0 'False

Strikethrough = 0 'False

EndProperty

ForeColor = &H00800000&

Height = 375

Left = 360

TabIndex = 16

Top = 1200

Width = 2655

End

Begin VB.Label Label3

Alignment = 2 'Center

BackStyle = 0 'Transparent

BeginProperty Font

Name = "Courier New"

Size = 42

Charset = 0

Weight = 700

Underline = 0 'False

Italic = 0 'False

Strikethrough = 0 'False

EndProperty

ForeColor = &H00800000&

Height = 975

Left = 0

TabIndex = 15

Top = 360

Width = 7335

End

End

Begin VB.Frame Frame1

Height = 1335

Left = 240

TabIndex = 3

Top = 3960

Width = 7095

Begin VB.CommandButton Command3

Caption = "Update"

Height = 255

Left = 1920

TabIndex = 12

Top = 1680

Visible = 0 'False

Width = 1455

End

Begin VB.TextBox Text1

Height = 285

Left = 2280

TabIndex = 10

Text = "Stub.exe"

Top = 360

Width = 2175

End

Begin VB.OptionButton Option4

Caption = "App Path"

Height = 255

Left = 5520

TabIndex = 9

Top = 840

Width = 975

End

Begin VB.OptionButton Option3

Caption = "Temp"

Height = 255

Left = 4440

TabIndex = 7

Top = 840

Width = 975

End

Begin VB.OptionButton Option2

Caption = "Windows"

Height = 255

Left = 3360

TabIndex = 6

Top = 840

Width = 975

End

Begin VB.OptionButton Option1

Caption = "System"

Height = 255

Left = 2280

TabIndex = 5

Top = 840

Width = 975

End

Begin VB.CheckBox Check1

Caption = "Run File After Install"

Height = 255

Left = 4800

TabIndex = 4

Top = 360

Width = 1815

End

Begin VB.Label Label1

Caption = "FileName After Run :"

Height = 255

Left = 600

TabIndex = 11

Top = 360

Width = 1575

End

Begin VB.Label Label2

Caption = "Unpack Where :"

Height = 255

Left = 600

TabIndex = 8

Top = 840

Width = 1215

End

End

Begin VB.CommandButton CmdBind

Caption = "Bind"

Height = 255

Left = 5880

TabIndex = 2

Top = 3600

Width = 1455

End

Begin VB.CommandButton CmdAddFile

Caption = "Add File"

Height = 255

Left = 240

TabIndex = 1

Top = 3600

Width = 1455

End

Begin MSComctlLib.ListView ListView1

Height = 3255

Left = 240

TabIndex = 0

Top = 240

Width = 7095

_ExtentX = 12515

_ExtentY = 5741

LabelEdit = 1

LabelWrap = -1 'True

HideSelection = -1 'True

FullRowSelect = -1 'True

_Version = 393217

ForeColor = -2147483640

BackColor = -2147483643

BorderStyle = 1

Appearance = 1

NumItems = 0

End

Begin MSComDlg.CommonDialog CommonDialog

Left = 3720

Top = 1680

_ExtentX = 847

_ExtentY = 847

_Version = 393216

CancelError = -1 'True

DefaultExt = "*.pak"

DialogTitle = "Open PAK"

Filter = "PAK File (*.pak)|*.pak"

Flags = 38930

End

Begin VB.Menu Menu_Item

Caption = "Item"

Visible = 0 'False

Begin VB.Menu Menu_Remove

Caption = "Remove this File"

End

End

End

Attribute VB_Name = "Form1"

Attribute VB_GlobalNameSpace = False

Attribute VB_Creatable = False

Attribute VB_PredeclaredId = True

Attribute VB_Exposed = False

Option Explicit

Private Const BinderName As String = "ZylomBinder"

Private Const BinderVersion As String = "1.0"

Private bGet As Boolean

Private bSet As Boolean

Private Sub CmdAddFile_Click()

On Error GoTo AddFileError

CommonDialog.Flags = &H1000 + &H4 + &H8 + &H800

CommonDialog.DialogTitle = "Add files to Bind"

CommonDialog.Filter = "All files (*.*)|*.*"

CommonDialog.DefaultExt = Empty

CommonDialog.ShowOpen

Me.Enabled = False

Me.MousePointer = 11

With Me.ListView1.ListItems.Add(, , CommonDialog.FileName)

.SubItems(1) = CommonDialog.FileTitle

.SubItems(2) = FileLen(CommonDialog.FileName)

.SubItems(3) = "1"

.SubItems(4) = "T"

End With

AddFileError:

Me.MousePointer = 0

Me.Enabled = True

End Sub

Private Sub CmdBind_Click()

On Error GoTo BindError

Dim v1 As Long

CommonDialog.Flags = &H400 + &H4 + &H8 + &H2 + &H800

CommonDialog.DialogTitle = "Save Binded file"

CommonDialog.Filter = "Exe File (*.exe)|*.exe"

CommonDialog.DefaultExt = ".exe"

CommonDialog.ShowSave

If (CommonDialog.FileName = Empty) Then

Exit Sub

End If

If FileExist(CommonDialog.FileName) = True Then Kill CommonDialog.FileName

Call BindFiles(CommonDialog.FileName)

MsgBox CommonDialog.FileName & vbCrLf & "was build OK", vbOKOnly + vbInformation, "Done"

BindError:

End Sub

Private Sub SetSettings()

Dim v1 As Integer

If bGet = True Then Exit Sub

bSet = True

v1 = Me.ListView1.SelectedItem.Index

Me.ListView1.ListItems.Item(v1).SubItems(1) = Me.Text1.Text

If Me.Check1.Value = 1 Then

Me.ListView1.ListItems.Item(v1).SubItems(3) = "1"

Else

Me.ListView1.ListItems.Item(v1).SubItems(3) = "0"

End If

If Me.Option4.Value = True Then Me.ListView1.ListItems.Item(v1).SubItems(4) = "A"

If Me.Option3.Value = True Then Me.ListView1.ListItems.Item(v1).SubItems(4) = "T"

If Me.Option2.Value = True Then Me.ListView1.ListItems.Item(v1).SubItems(4) = "W"

If Me.Option1.Value = True Then Me.ListView1.ListItems.Item(v1).SubItems(4) = "S"

bSet = False

End Sub

Private Sub GetSettings()

If bSet = True Then Exit Sub

bGet = True

Me.Text1.Text = Me.ListView1.SelectedItem.SubItems(1)

If Me.ListView1.SelectedItem.SubItems(3) = "1" Then

Me.Check1.Value = 1

Else

Me.Check1.Value = 0

End If

If UCase(Me.ListView1.SelectedItem.SubItems(4)) = "A" Then Me.Option4.Value = True

If UCase(Me.ListView1.SelectedItem.SubItems(4)) = "T" Then Me.Option3.Value = True

If UCase(Me.ListView1.SelectedItem.SubItems(4)) = "W" Then Me.Option2.Value = True

If UCase(Me.ListView1.SelectedItem.SubItems(4)) = "S" Then Me.Option1.Value = True

bGet = False

End Sub

Private Sub Command4_Click()

Me.Frame2.Visible = False

Me.Height = 5865

Me.Width = 7695

Me.ListView1.Visible = True

End Sub

Private Sub Form_Load()

On Error GoTo LoadError

Dim StubSize As Long

Dim StubPath As String

Me.ListView1.Visible = False

Me.Width = 7695

Me.Height = 2955

Me.Frame2.Height = 2295

Me.Frame2.Width = 7335

Me.Frame2.Top = 120

Me.Frame2.Left = 120

Me.Label3.Caption = BinderName

Me.Label4.Caption = "Version " & BinderVersion

ListView1.View = lvwReport

With ListView1.ColumnHeaders

.Add , , "FilePath", 4000

.Add , , "FileName", 1500

.Add , , "FileSize", 1500

.Add , , "Run File", 1500

.Add , , "Unpack Where", 1500

End With

Me.ListView1.GridLines = True

StubPath = App.Path & "\stub.exe"

StubSize = FileLen(StubPath)

With Me.ListView1.ListItems.Add(, , StubPath)

.SubItems(1) = "Stub.exe"

.SubItems(2) = FileLen(StubPath)

.SubItems(3) = "1"

.SubItems(4) = "A"

End With

Me.Caption = BinderName & "-v" & BinderVersion & " StubSize = " & StubSize

Exit Sub

LoadError:

MsgBox Err.Description, vbCritical + vbOKOnly, "Error"

Err.Clear

End

End Sub

Private Sub BindFiles(BindFile As String)

Dim v1 As Long

Dim v2 As Long

Dim v3 As Long

Dim Str1 As String

Dim Data() As Byte

v2 = 1

For v1 = 1 To Me.ListView1.ListItems.Count

v3 = FileLen(Me.ListView1.ListItems.Item(v1))

ReDim Data(v3 - 1)

Open Me.ListView1.ListItems.Item(v1) For Binary Access Read As #1

Get #1, , Data()

Close #1

Open BindFile For Binary As #1

Put #1, v2, Data()

Close #1

v2 = v2 + v3

DoEvents

Next v1

For v1 = 1 To Me.ListView1.ListItems.Count

Str1 = Str1 & Me.ListView1.ListItems.Item(v1).SubItems(1) & "|" & Me.ListView1.ListItems.Item(v1).SubItems(2) & "|" & Me.ListView1.ListItems.Item(v1).SubItems(3) & "|" & Me.ListView1.ListItems.Item(v1).SubItems(4) & "|"

Next v1

Open BindFile For Binary As #3

Put #3, LOF(3) + 1, "<>" & Str1 & "</>"

Close #3

End Sub

Private Sub ListView1_Click()

Call GetSettings

End Sub

Private Sub ListView1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)

If Me.ListView1.ListItems.Count > 0 Then

If Button = 2 Then PopupMenu Menu_Item

End If

End Sub

Private Sub Menu_Remove_Click()

Dim v1 As Integer

v1 = Me.ListView1.SelectedItem.Index

If v1 > 1 Then

Me.ListView1.ListItems.Remove (v1)

End If

End Sub

Private Function FileExist(FileName As String) As Boolean

If Dir(FileName) <> Empty Then

FileExist = True

Else

FileExist = False

End If

End Function

Private Sub Option1_Click()

Call SetSettings

End Sub

Private Sub Option2_Click()

Call SetSettings

End Sub

Private Sub Option3_Click()

Call SetSettings

End Sub

Private Sub Option4_Click()

Call SetSettings

End Sub

Private Sub Check1_Click()

Call SetSettings

End Sub

Private Sub Text1_Change()

Call SetSettings

End Sub

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...