Application library ApplName() ApplControl()
Programming guideline of WinDom

ApplWrite()

NAME

ApplWrite - send a message to a GEM process.

PROTOTYPAGE

/* Prototype for 16 bits compilers */
int ApplWrite( int to, int msg, ...);
/* Prototype for 32 bits compilers */
int ApplWrite( int to, int msg, int w3, int w4, int w5, int w6, int w7);

PARAMETERS

to:
AES id of the targeted process,

msg:
message number to send,

...:
these parameters should fill the words 3 to 7 of the AES message pipe.

return:
the value returned by appl_write().

DESCRIPTION

This function is just an usefull call to the appl_write() AES function. It replaces the obsolet snd_msg() WinDom function. This function have two implementations : one for compilers which have a integer size of 16 bits and one for compilers wich have a interger size of 32 bits. For the second one, all pointer parameters should be absolutely encapsuled by the macro function ADR() because integer parameter and pointer parameter have the same 32 bits size. So we use the fixe prototype of 5 integer parameters to prevent during the compilation this king of error.

EXAMPLE

Instead of write :

             {
                 int pipe[8];
                 char p[] = "C:\\NEWDESK.INF";
     
                 pipe[0] = VA_START;
                 pipe[1] = app.id;
                 pipe[2] = 0;
                 pipe[3] = strcpy( app.pipe, *(char**) & p);
                 appl_write( id_target, 16, pipe);
             }
just write:

             ApplWrite( id_target, VA_START, ADR(strcpy(app.pipe,"C:\\NEWDESK.INF")), 0, 0);
Macro ADR() is required by 32-bits compilers but not for 16-bits. However, to increase the portability, we recommend to use ADR() macro function for pointer arguments. app.pipe is just a buffer in global memory reserved by WinDom and used for communications with extern GEM application. It is not required for internal communications.

SEE ALSO

appl_write(), snd_rdw(), Galloc().