r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[SDK]

Anton
10-Aug-2006
[630]
Check how much of that path exists. That full path should exist at 
the beginning of the script (at least just after you have included 
view).
james_nak
10-Aug-2006
[631x2]
Thanks Anton and Graham. I forgot my own first rule of  programming: 
 "When all is said and done, it's probably 'User Error.'
My memory stick that I use did not have enough space for the resulting 
file! Encap, rather than complaining just wrote what it could. After 
making some space, it did its job. I did locate some words that were 
not yet defined so I did a "Search in files" to look for where they 
might be in the sdk/source files. Finding them I "#include"'d the 
source and wow, now it works. 


So Graham you were right. It was missing View. And Anton, next time 
I will check the path; that's a much quicker way to proceed.

It all makes sense now that I'm on the other side of success.
Anton
10-Aug-2006
[633]
Glad that it was something simple :)
Rondon
14-Aug-2006
[634]
Hi Folks. I'd Like to customize the window title for my rebol encaped 
programs.. not with rebview, but rebcommand.. The program is a cgi 
.exe encapsulated. but the window title, when I run it out of the 
browser appears "Rebol -". Can I change that ?
Graham
14-Aug-2006
[635x2]
have to use a windows library call.
can't remember which one though
Anton
15-Aug-2006
[637]
possibly shell32.dll
Graham
15-Aug-2006
[638]
win-lib: make object! [
	
	user-lib: load/library %user32.dll

	SetWindowText: make routine! [
		handle			[integer!]
		Title			[string!]
		return:			[integer!]
	] user-lib "SetWindowTextA"
	
	set 'WindowTitle func [
		Title [string!] 
	] [
		SetWindowText get-modes system/ports/system 'window Title
	]	
]
Maxim
13-Sep-2006
[639]
strange question, is SDK   view 1.3 based?
Gabriele
13-Sep-2006
[640]
yes, if you have the latest update.
Maxim
19-Sep-2006
[641x5]
is there any way to get an encapped application to send data to normal 
DOS stdout stderr (NOT IN REBOL CONSOLE)... I don't care how kludgy, 
even if it means compiling or using a dll with stdio.h included, 
just to access it...
There are things in the universe I just don't understand...
I can load - parse - save a web page directly from the net in one 
line of rebol...
yet It seems impossible to even do a proper stdout call, so that 
another application can use my app's output ... (on windows).  I 
mean its just the most basic thing in any language.
can anyone tell me how I can encap something which would duplicate 
using the -c switch from standard rebol?  (which seems to allow me 
to pipe out )
Volker
19-Sep-2006
[646]
http://www.rebol.com/docs/sdk/encap.html#section-8
Maxim
19-Sep-2006
[647x2]
thanks Volker, I have been trying to get to grips with the SDK.  
Somehow, I am lost when trying to find specific information... many 
times I try subjects, and I either encounter unfinished, incomplete 
or missing docs.   I do find some usefull tidbits here and there.... 
but its a pretty dry ride so far...
so far cgi in the header seems to work like a charm.  THANK YOU volker 
 :-)
Maxim
20-Sep-2006
[649x2]
now, why does using 'CALL within an encapped app cause it to freeze 
up and use 100% system CPU?
hum strange... the DOS prompt returns, yet I still have my encapped 
app running in the task list (at 100%)! my god, how is this possible?
Graham
20-Sep-2006
[651]
call doesn't make encapped apps to freeze .. I use it all the time.
Maxim
20-Sep-2006
[652]
hum  do you use it with any refinements? have you tried it specifically 
with the cgi option?
Graham
20-Sep-2006
[653]
yes, and no.
Maxim
20-Sep-2006
[654x3]
ok, I guess its the stdout redirection which causes it to go wild...
(using cgi)
have you been able to print to the real stdout , allowing your encapped 
app to print within the DOS shell or be used within pipes?
Graham
20-Sep-2006
[657x2]
never tried.
to print ... I call other applications, or send stuff to lpt1
Maxim
20-Sep-2006
[659]
I guess I should have said piped, or streamed to stdout.  I don't 
really want to print on paper ... but I guess you understood...
Gabriele
20-Sep-2006
[660]
Maxim, the Detective uses the cgi option, and prints to the dos command 
prompt if you call it from there (try running "nren help"). It does 
not use call though, but async-call, but i don't remember problems 
with call + cgi options.
Louis
20-Sep-2006
[661]
Is it possible to encap data files into the same .exe file as the 
script that uses them?
Geomol
20-Sep-2006
[662]
Louis, yes: http://www.rebol.com/docs/sdk/encap.html
Louis
20-Sep-2006
[663]
Germol, thanks. I thought I remembered reading that it was possible. 
I'll read the docs again to figure out how.
Gabriele
20-Sep-2006
[664]
#include-string and #include-binary are what you are looking for, 
i think.
Louis
20-Sep-2006
[665]
Gabriele, thanks.
Maxim
21-Sep-2006
[666x11]
Gabriele: asynch-call?
Gabriele, my issue, is that I am trying to capture the output of 
the applications I call.  For this I need to use /console AFAIK. 
 but when I do so, the encapped app just goes mad and enters some 
kind of deadlock at 100% cpu usage.
async-call :  WOW !  direct re-implementation using kernel32 lib!
I will test using it.  the page talks about a polling loop which 
consumes a lot of cpu... can this be improved (like inserting a wait 
0.01) ?
anyone tried killing currently running tasks?  or now how to?  this 
could be an interesting opportunity for me.
about fixing cpu busy look :-)  found a working solution.

; wherever you insert the asynch call  to system wait list... you 
also add 0.1 (or any other appropriate value for your app)
; this will obviously quit the event loop immediately.
append system/ports/wait-list clist
append system/ports/wait-list 0.1


then, where you normally call do-events OR at the end of your app, 
if not using do-events manually... you put the following:
forever [
	do-events 
]

and you have a 0% CPU consuming multiple asynch call loop.  I tried 
with the ping demo provided with async-call and it works perfectly 
on all the tests I did.
The only thing you now need to do is trap an exit condition within 
your forever loop, otherwise the application runs in the background 
forever.
; something like:
if empty? system/view/screen-face/pane [quit]
well, I did a little bit more testing and the above procedure does 
not seem to reduce rebol CPU usage while waiting for calls.  but 
I do have a method which allows you to trade off view interactivity 
for diminished cpu usage.  This obviously also slows down the async 
calls interactivity, but in most cases, this is not a real concern.
here is a new procedure (very effective)

append ports: system/ports/wait-list call-ports-list
append system/ports/wait-list 0.001
forever [
	system/ports/wait-list: []
	wait 0.1
	system/ports/wait-list: ports
	do-events
	if empty? system/view/screen-face/pane [quit]
]
but now, the same application (ping-demo) consumes at most 10% activity 
and often under 5%  and there is almost NO discernable difference 
in view interactivity and overall call feedback !
Gabriele
21-Sep-2006
[677]
Maxim, no, you need /output to capture the output; /console sends 
the output to the console, but there is no console if you use the 
cgi option, so probably this does not work correctly.
Maxim
21-Sep-2006
[678x2]
/output does the same thing
/wait too.