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


Groups > comp.lang.forth > #18930

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 <91698915028434@frunobulax.edu> (permalink)
Date 2013-01-20 14:34 +0200
References <68199115028434@frunobulax.edu>
Organization Wanadoo

Show all headers | View raw


AKE <assadebrahim2000@gmail.com> writes Re: Wanting to use Shared Memory in Win32Forth using Win32 -- but stuck at MessageBoxA( ) !

>> ... it works as expected. 
> Hmm.  Did you see a Message Box appear with an OK button when you ran it?

Yes, it did. It probably works because the TOS contains 0 when I boot 
Win32Forth. You may have done something before defining hi, making TOS
an invalid style constant.

Technically, your example creates a stack underflow. You should
always supply a stackdiagram for your words. I didn't notice 
that I should supply a style constant and expect a result.

Your correction:

: hi
40                        \ style constant: MB_ICONINFORMATION
z" Hello World!" rel>abs  ( -- str_msg )
z" Title" rel>abs         ( -- str_title )
NULL                      \ handle (independent)
call MessageBoxA          ( n ptr ptr h -- ret )
;

produces the information icon and a sound effect, HOWEVER, one
should type $40 and not 40. The (decimal) style constant 
"40" is not valid with Windows 7 and no message box appears at all.

>> Are you using Windows? (Not Linux and Wine)?
> Yes, Windows XP

I tested using Windows 7.
 
>> Are you using the proper Win32for binary?
>Currently using Version 6.08.00.
>Also tried it in Tom Zimmer's last version: 42.0602
>(Downloaded from Win32Forth)

I guess it should work, unless they got rid of the reverse
parameters for Windows calls (Try NULL title msg style -- res).

>> What happens when you try to compile?
>Haven't tried compiling.  Do I need to?  I was hoping it would 
> work from the interactive terminal.

In Forth, pasting in the text leads to the word "hi" being compiled. 
It may produce error messages in this stage. Then typing "hi" 
executes the word and ... hold on, you DID type  hi  at the prompt,
after pasting the text, didn't you :-)

>> What happens when you try to execute  hi ?
> All 4 parameters get used up; get a 0 return value on the stack 
> (correct), but no message box!

That happened when I tried it with decimal 40 as a style constant.

[..]

 
>> Do you know about the Yahoo Forth group?
>I saw both Google Groups (comp.lang.forth) and Yahoo Groups. 
>Since I already have google accounts, chose comp.lang.forth.  
>Is there a difference?  Preference?  

The real Win32Forth gurus lurk at Yahoo, for some reason.

>> Please do not post using mime.
>...?   I'm using Google Groups web interface... is this a setting 
>I should disable?

I see you're learning fast. Welcome!

-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