🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #38208

AES Messages: Sending messages to yourself problem.

#38208
From: CrackerJack
Date: Mon, 24 Apr 1989 20:31
68 lines
2224 bytes
I wish to thank everyone for the answers to my first question about
strings. However I'm still having trouble sending messages to myself.
Below is an example test case that does NOT work. Could someone tell 
me why I don't receive anything.

--->8---

#include <sys\gemdefs.h>

int ApplHandle;
int Dummy;
int Event;
int Msg[8];


void SendMsg( code )
    int code;
{
    int msg[3];

    printf( "Sending message %d\n", code );
    /* set message code. note that this value should not be equal to any of
       the standard GEM messages ( >31 ). */
    msg[0] = code;
    msg[1] = ApplHandle;
    /* Number of bytes extra to read after initial 16 byte message. */
    msg[2] = 0;
	if( appl_write( ApplHandle, 6, msg ) == 0 )
		printf( "appl_write failed\n" );
}


void ChkMsg()
{
    printf( "Message %d received\n", Msg[ 0 ] );
}


void main()
{
    ApplHandle = appl_init();

    SendMsg( 100 );

    for(;;){
        Event = evnt_multi( MU_KEYBD | MU_BUTTON | MU_MESAG,
                            1, 0x3, 1,
                            0, 0, 0, 0, 0,
                            0, 0, 0, 0, 0,
                            Msg, 0, 0,
                            &Dummy, &Dummy, &Dummy, &Dummy, &Dummy, &Dummy );

		/* exit on left mouse button press */
        if( Event & MU_BUTTON ) break;

		/* send a message on a keypress */
        if( Event & MU_KEYBD ) SendMsg( 101 );

		/* see what has arrived for us */
        if( Event & MU_MESAG ) ChkMsg();
    }

    appl_exit();
}
   achowe@tiger.waterloo.edu      |  "Murdered by pirates is good."
 __                    _          |    - The Princess Bride (movie)
/   _  _  _ |/ _  _    | _  _ |/  |
\__| `<_\<_ |\|= | ` \_/<_\<_ |\  |                        disclaimer...
Technical Details
Message-ID: <13445@watdragon.waterloo.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!watdragon!tiger!achowe

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!watdragon!tiger!achowe
From: achowe@tiger.waterloo.edu (CrackerJack)
Newsgroups: comp.sys.atari.st
Subject: AES Messages: Sending messages to yourself problem.
Message-ID: <13445@watdragon.waterloo.edu>
Date: 24 Apr 89 20:31:10 GMT
Sender: daemon@watdragon.waterloo.edu
Reply-To: achowe@tiger.waterloo.edu (CrackerJack)
Distribution: world
Organization: U. of Waterloo, Ontario
Lines: 68