Hello Charles ..and others of course..
I finally find some time to try to rebuild this Binder program.
I can say that Binding work ...
here is my prog:
$ filename "Bind32.exe"
uses RTL32
' embedfile "t.txt",d
' byte exef,srcf
exef = getfile "C:\GUIApp.exe"
print len(exef) + " bytes"
srcf = getfile "C:\mySrc.txt"
print len(srcf) + " bytes"
putfile "C:\MyRuntime.exe",exef + srcf
print "OK..." + len exef + srcf
and here is simple GUI program with one button
which should trigg or better to say load binded string from the end of exe .
Binded string is just ordinary .txt file called mySrc.txt which contain text ---> "Aurel"
so i tried to load with your suggested method
case b1ID 'open file
if notifycode=0
'call our binded string ....
sf = getfile("C:\GUIApp.exe")
src = mid(sf,22528,5) '22528 + 1 ..add LEN of src
print strptr src
end if
when i try it without strptr then i get nothing in message box
when i use strptr then i get adress ( number)
so my question is how to get it as string text ?
here is code of GUI app
'test GUI app as runtime to call binded string from himself
$ filename "GUIApp.exe"
include "rtl32.inc" : include "awinh037.inc" : #lookahead
'globals
INT win,x=0,y=0,w=400,h=300,wstyle = WS_MINMAXSIZE
INT button1, b1ID = 100
STRING sf ' src file
STRING src ' source str
' open window
win = SetWindow("Skeleton GUI 038 App...",x,y,w,h,0,wstyle)
'create button control
SetButton(win ,10,40,100,32,"Call String ?",0x50001000,0x200,b1ID)
Wait() '/// message loop function ///
Function WndProc(sys hwnd,wmsg,wparam,lparam) as sys callback
win = hwnd 'assign WIN with HWND
SELECT hwnd
CASE win
Select wmsg
'case WM_CREATE
'button1 = SetButton(win,10,40,80,26,"Call string ...",0x50001000,0x200,b1ID)
case WM_COMMAND
controlID = LoWord(wParam) 'get control ID
notifyCode = HiWord(wParam) 'get notification message
select controlID
'...................................................
case b1ID 'open file
if notifycode=0
'call our binded string ....
sf = getfile("C:\GUIApp.exe")
src = mid(sf,22528,5) '22528 + 1 ..add LEN of src
print strptr src
end if
'...................................................
end select
CASE WM_CLOSE
CloseWindow(win)
EndProgram
End Select
END SELECT
RETURN Default
END FUNCTION
Well...this method ..if work can be used for so many things like config inside .exe or similar..
thnx