Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #18924

Re: Wanting to use Shared Memory in Win32Forth using Win32 -- but stuck at MessageBoxA( ) !

From mhx@iae.nl (Marcel Hendrix)
Subject Re: Wanting to use Shared Memory in Win32Forth using Win32 -- but stuck at MessageBoxA( ) !
Newsgroups comp.lang.forth
Message-ID <68199115028434@frunobulax.edu> (permalink)
Date 2013-01-20 12:16 +0200
References <5fb78940-c093-40b5-affc-b2465e2877bb@googlegroups.com>
Organization Wanadoo

Show all headers | View raw


AKE <assadebrahim2000@gmail.com> Re: Wanting to use Shared Memory in Win32Forth using Win32 -- but stuck at MessageBoxA( ) !
[..]
> And... embarassingly, I can't even get a simple MessageBoxA( ) call to work in Forth.

> I've been through the documentation, but can't seem to find the problem.
>
> Here's what I've got.  Any help would be greatly appreciated!
>
> : hi
> z" Hello World! (from Forth)" rel>abs	\ string ( -- msg_str_ptr len )
> z" Extending Forth with Win32" rel>abs 	\ string ( -- title_str_ptr len )
> NULL					\ ( -- 0 )
> call MessageBoxA			\ ( style_param  msg_str_ptr  title_str_ptr  handle -- )
> ;

When pasted into the Win32For console window:

--- 8< ------------------------------------------------
32bit Forth for Windows 95, 98, and NT
Compiled: October 18th, 2006, 0:19am
 Version: 4.2  Build: 0545  Rebuilt by User
Platform: Windows NT Version: 6.1  Build: 7601
3,815k bytes free
 2,904 Words in Application dictionary
 1,445 Words in System dictionary
 4,349 Words total in dictionaries
 9,462 Windows Constants available

Loading Win32For.CFG

*** DON'T PANIC, Press: F1 NOW! ***

: hi
z" Hello World! (from Forth)" rel>abs  \ string ( -- msg_str_ptr len )
z" Extending Forth with Win32" rel>abs \ string ( -- title_str_ptr len )
NULL \ ( -- 0 )
call MessageBoxA \ ( style_param  msg_str_ptr  title_str_ptr  handle -- )
;  ok
hi  ok
.s  empty  ok
--- 8< -----------------------------------------------------

... it works as expected. 
Are you using Windows? (Not Linux and Wine)?
Are you using the proper Win32for binary?
What happens when you try to compile?
What happens when you try to execute  hi ?
What happens when you use MessageBox and not MessageBoxA ?
Do you know about the Yahoo Forth group?

Please do not post using mime.

-marcel

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Wanting to use Shared Memory in Win32Forth using Win32 -- but stuck at MessageBoxA( ) ! AKE <assadebrahim2000@gmail.com> - 2013-01-20 02:52 -0800
  Re: Wanting to use Shared Memory in Win32Forth using Win32 -- but stuck at MessageBoxA( ) ! mhx@iae.nl (Marcel Hendrix) - 2013-01-20 12:16 +0200
    Re: Wanting to use Shared Memory in Win32Forth using Win32 -- but stuck at MessageBoxA( ) ! AKE <assadebrahim2000@gmail.com> - 2013-01-20 03:25 -0800
    Re: Wanting to use Shared Memory in Win32Forth using Win32 -- but stuck at MessageBoxA( ) ! mhx@iae.nl (Marcel Hendrix) - 2013-01-20 14:34 +0200
  Re: Wanting to use Shared Memory in Win32Forth using Win32 -- but stuck at MessageBoxA( ) ! AKE <assadebrahim2000@gmail.com> - 2013-01-20 03:17 -0800
  Re: Wanting to use Shared Memory in Win32Forth using Win32 -- but stuck at MessageBoxA( ) ! AKE <assadebrahim2000@gmail.com> - 2013-01-20 06:15 -0800
    Re: Wanting to use Shared Memory in Win32Forth using Win32 -- but stuck at MessageBoxA( ) ! Alex McDonald <blog@rivadpm.com> - 2013-01-20 11:31 -0800
      Re: Wanting to use Shared Memory in Win32Forth using Win32 -- but stuck at MessageBoxA( ) ! AKE <assadebrahim2000@gmail.com> - 2013-01-20 15:21 -0800
        Re: Wanting to use Shared Memory in Win32Forth using Win32 -- but stuck at MessageBoxA( ) ! Alex McDonald <blog@rivadpm.com> - 2013-01-21 08:23 -0800
          Re: Wanting to use Shared Memory in Win32Forth using Win32 -- but stuck at MessageBoxA( ) ! albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-01-21 18:25 +0000
            Re: Wanting to use Shared Memory in Win32Forth using Win32 -- but stuck at MessageBoxA( ) ! Alex McDonald <blog@rivadpm.com> - 2013-01-21 11:51 -0800

csiph-web