programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: Compiling Win32 executable

From: Mike Ghan <MikeGhan_at_logix-controls.com>
Date: Thu, 18 May 2006 12:31:36 -0700

Note that SampleDialog.F creates a *modeless* dialog (ex a typical
search/replace dialog) which relies on a parent window's dispatcher.
When turnkeyed, HWND returns 0 as a parent window does not yet exist.
We can use the Desktop's window instead.

Try the following (untested)

: SAMPLE
   HINST (SAMPLE) GetDesktopWindow RUNSAMPLE 0
   CreateDialogIndirectParam DROP
   'ONSYSEXIT CALLS \ Execute System Exit Chain (Cleanup)
   0 ExitProcess ;

The phrase 'ONSYSEXIT CALLS is important - while many structures are
cleaned up for you when to terminate a Windows app, some are not. A
well behaved app should not rely on Windows to cleanup after itself.

I've found :PRUNE to be impractical in a Windows environment - I never
use it.

Hope this helps,
Mike

> -----Original Message-----
> From: sftalk-bounce_at_forth.com
> [mailto:sftalk-bounce_at_forth.com] On Behalf Of Tony Senerchia
> Sent: Thursday, May 18, 2006 11:51 AM
> 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
> ----------------------------------------------------------------------
>
>
----------------------------------------------------------------------
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:32:30 PDT

This archive was generated by hypermail 2.2.0 : Thu Dec 04 2008 - 03:04:21 PST