From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 17-JUL-1989 22:03
To:	MRGATE::"ARISIA::EVERHART"
Subj:	Re: Calling mechanism for DwtDECtermPort() wanted

Received: From KL.SRI.COM ([0.0.0.0]) by CRVAX.SRI.COM with TCP; Mon, 17 JUL 89 18:05:43 PDT
Received: from ucbvax.Berkeley.EDU by KL.SRI.COM with TCP; Mon, 17 Jul 89 17:43:31 PDT
Received: by ucbvax.Berkeley.EDU (5.61/1.37)
	id AA29265; Mon, 17 Jul 89 17:30:42 -0700
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 17 Jul 89 01:47:28 GMT
From: uhccux!munnari.oz.au!otc!metro!basser!usage!decus!taylort@ames.arc.nasa.gov  (Trevor Taylor)
Organization: DECUS, South Pacific Chapter
Subject: Re: Calling mechanism for DwtDECtermPort() wanted
Message-Id: <425@decus.com.au>
References: <2586@quanta.eng.ohio-state.edu>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

In article <2586@quanta.eng.ohio-state.edu>, DAVISM@kcgl1.eng.ohio-state.edu (Michael T. Davis) writes:
> 	I would very much like to use the DwtDECtermPort call to instantiate
> a DECterm window.  As far as I can tell, this call is only mentioned when you
> RUN SYS$SYSTEM:DECW$TERMINAL.  It informs the user that DECterm is now ready
> and that (s)he should create DECterms with either the Session Manager or
> the DwtDECtermPort() call from another process.  I would appreciate any
> pointers as to the calling mechanism for this routine, especially sample code
> (;-).
> 

The documentation is in the VMS V5.1 Release Notes. However ...

*** FLAME ON ***

There is one parameter which is a "setup string". There is NO
documentation on what the valid setup parameters are. This is
just one example of the gaping holes in the doc set. By the
way, the full Technical Doc set does not even mention this routine.
Basically this gets back to the Resource Name issue which I have
raised in the past. The only way around it is to get an ULTRIX
doc set. Isn't it interesting that UEG is showing up the VMS
people?

*** FLAME OFF ***

As it turns out, I use another one of the parameters, which is
the name of a setup file. This is just a standard file like
DECW$TERMINAL_DEFAULT.DAT. However, and here is the nice part,
you can use separate files for different applications. If you
then attempt to customise these terminal windows, they each
write back to their respective files! Very nice!

To create a DECterm from DCL, it is very easy:
	$ RUN SYS$SYSTEM:DECW$MAIL_CREATEDECTERM
(A side-effect from DECW$MAIL.)

For a "plain vanilla" version from a program, use:

    char device[50];
    int dev_len;

    decwtermport(0, 0, 0, device, &dev_len);
    ...

device[] will contain the device name and dev_len is the
length of the string. You can then assign a channel to
the device if you like and talk to it like a terminal,
or leave it alone and allow the user to log in. (It
will prompt for username and password like any real
terminal.)


	Trevor

