Jump to content

VioWrtTTY

From EDM2
Revision as of 02:50, 4 January 2006 by Myrkraverk (talk | contribs) (A short documentation on the function)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Here is some documentation, based on my hello world.

The following is a prototype, that works with OpenWatcom 1.3.

APIRET VioWrtTTY( char *string, unsigned short length, unsigned short VioHandle );

To get the prototype do:

#define INCL_VIO

#include <os2.h>

The Control Program Programming Guide and Reference (that comes with the OS/2 Tool Kit 4.52) documents string as PCH, which is unsigned char * but that does not work with OpenWatcom 1.3.

The VioHandle must be 0, unless the caller is a Presentation Manager application, and then it must have been returned by VioCreatePS.

A sample, hello world:

#define INCL_VIO

#include <os2.h>

int main( int argc, char *argv[] )
{
        APIRET rc = VioWrtTTY( "Hello, VIO\n", // string to write
                               11,             // lenght of string to write
                               0 );            // VIO handle, must be 0
        return rc;
}