![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

This works pretty well for us:
- Roger
REQUIRES myfiles.F \ Put source code for turnkey here
: TURNKEYFUNCTION myword ; \ Put turnkey word here for use.
CREATE AppName ,Z" Turnkey"
[SWITCH TURNKEY-MESSAGES DEFWINPROC ( -- res )
WM_DESTROY RUN: 0 PostQuitMessage DROP 0 ;
SWITCH]
:NONAME MSG LOWORD TURNKEY-MESSAGES ; 4 CB: TURNPROC
: TURNWINDOW ( -- hwnd )
0 \ extended style
AppName \ window class name
Z" All Done!" \ window caption
WS_OVERLAPPEDWINDOW \ window style
CW_USEDEFAULT \ initial x position
CW_USEDEFAULT \ y
60 \ x size
20 \ y
0 \ parent window handle
0 \ window menu handle
HINST \ program instance handle
0 \ creation parameter
CreateWindowEx ;
: SIMPLE-CLOSE ( -- res ) HWND 0 EndDialog ;
: DEMO ( -- )
AppName TURNPROC DefaultClass DROP
TURNWINDOW DUP SW_SHOWDEFAULT ShowWindow DROP
UpdateWindow DROP
DISPATCHER DROP ;
: WINMAIN ( -- )
DEMO 0 ExitProcess ;
' WINMAIN 'MAIN !
[+SWITCH TURNKEY-MESSAGES ( -- res )
WM_CREATE RUN: TURNKEYFUNCTION simple-close 0 ExitProcess 0 ;
SWITCH]
-1 THRESHOLD
PROGRAM myword.EXE myicon.ico
bye
-----Original Message-----
From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com] On Behalf Of
Tony Senerchia
Sent: Thursday, May 18, 2006 2:51 PM
To: sftalk_at_forth.com
Subject: [sftalk] Compiling Win32 executable
Hi,
I'm working on a project for one of my classes for which I would like to get
an executable file from my code, a simple .EXE.
I've looked through the samples in the SF directories, but I can't seem to
work it out- my .EXE's either do nothing at all or, in the worst case, give
an error saying that SF needs to be closed and ask if I would like to report
this to Windows.
What I would like to know is, why, when I insert
: SAVE
['] SAMPLE 'MAIN ! -1 THRESHOLD
S" PROGRAM SAMPLE.EXE" EVALUATE ;
into the Sampledialog.f program (Lib-> Samples-> Win32) then run SAVE from
SF, I get an .EXE that just won't work. Is it the coding of the window,
registering the class, etc that is not being done?
And where can I find out what :PRUNE does, because I don't understand it?
...
For background-
I've written a simple program to do some ftp transfer work. It's works
really well in SF- I use a single window and the DIALOG END-DIALOG to add my
buttons and edittext boxes. It simply won't compile though, OR it spits out
an .EXE that will run once iff SF is open, then gives me the error and will
not run again (it only gives the error afterwards).
Thanks for any help, hope I was clear enough in the discription of the
problem.
A. Senerchia
PS- If this is all really simple stuff, could someone point me towards a
good source of information for figuring it out? Thanks so much!
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
-- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.6.0/342 - Release Date: 5/17/2006 ---------------------------------------------------------------------- sftalk_at_forth.com The SwiftForth programming discussion email list To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com For list command help, send subject "help" to sftalk-request_at_forth.com Message archives are located at http://www.forth.com/archive/sftalk ---------------------------------------------------------------------- This list is a forum for SwiftForth users. For product support and bug reports, please send email to support_at_forth.com ----------------------------------------------------------------------Received on Thu May 18 2006 - 12:08:06 PDT
This archive was generated by hypermail 2.2.0 : Thu Dec 04 2008 - 03:04:21 PST