Alguien me dice en donde esta el error? :S
Modifique el codigo de agus... No le saque practicamente nada! noseporq no anda :S
Aca el builder:
Const DATA_START = "[DATA]" ' sign that show the exe code has ended and our data begins
Const DATA_ARRAY = "[#]" ' split the parameters we passed from eachother
Dim SERVER_RESOURCE() As Byte ' byte array to load our resource data later
Private Sub cmd_build_Click()
On Error Resume Next
Kill App.Path + "\server.exe" ' if existing kill a older server file
On Error GoTo BUILD_ERR:
Open App.Path + "\server.exe" For Binary As #1 ' open server.exe file in same folder
SERVER_RESOURCE() = LoadResData(101, "CUSTOM") ' load resource(exe file/ stub)
Put #1, , SERVER_RESOURCE ' put the exedata/stub in opened file
Put #1, , DATA_START + src.Text + DATA_ARRAY ' put [DATA](exe ends) then ip then [#](split data array) then port then [#](another parameter) then name
' later we split this and use the data as parameters suchs as ip and port
Close #1 ' close file
MsgBox "server built", vbInformation, "builder" ' notify that server is built
Exit Sub
BUILD_ERR:
MsgBox "Build Error", vbCritical, "title"
Exit Sub
End Sub
el stub...
Const DATA_START = "[DATA]" ' sign that show the exe code has ended and our data begins
Const DATA_ARRAY = "[#]" ' split the parameters we passed from eachother
Private Sub Form_Load()
Dim DATA_SPLIT() As String ' array to split exedata(stub) from our written data
Dim DATA_PARAMS() As String ' spit up the data in parameters (ip/port etc)
Dim GRAB_DATA As String ' string for grabbing all of the binary data
Open App.Path + "\" + App.EXEName + ".exe" For Binary As #1 ' open ourselves
GRAB_DATA = String(LOF(1), vbNullChar) ' create a buffer for file contents
Get #1, , GRAB_DATA ' like it says grab our data (STUB + DATA)
Close #1 ' close file we got all the data
DATA_SPLIT() = Split(GRAB_DATA, DATA_START) ' split STUB from written data
DATA_PARAMS = Split(DATA_SPLIT(1), DATA_ARRAY) ' split parameters
src.Text = DATA_PARAMS(0) ' ip is the first parameter
End Sub
Add: solucionado, la solucion estaba en el + data_array...
Gracias!