[mod.computers.vax] SMG problem and help requested

m1b@rayssd.UUCP (M. Joseph Barone) (07/25/86)

	Has anyone had any success with the SMG routine,
SMG$DISABLE_UNSOLICITED_INPUT in VAX C.  I'm running VMS V4.4
and C V2.2.  I tried the three permutations below and received
the noted error messages.  The first attempt is the way it is
documented in the RTL Part II (5D) reference manual.

Attempt #1:
...
	unsigned int	new_pid;
	int	status;

	status = smg$create_pasteboard(&new_pid,0,0,0,0);
	if (status != SS$_NORMAL) exit(status);
	status = smg$disable_unsolicited_input(&new_pid);
	if (status != SS$_NORMAL) exit(status);
...

The error message was "invalid I/O channel"

Attempt #2:
...
	unsigned int	new_pid;
	int	status;
	int	chan;
	$DESCRIPTOR(TERM,"SYS$COMMAND");

	status = sys$assign(&TERM, &chan, 0, 0);
	if (status != SS$_NORMAL) exit(status);
	status = smg$create_pasteboard(&new_pid,0,0,0,0);
	if (status != SS$_NORMAL) exit(status);
	status = smg$disable_unsolicited_input(&chan);
	if (status != SS$_NORMAL) exit(status);
...

The error message was "invalid pasteboard-id"

Attempt #3:
...
	unsigned int	new_pid,new_kid;
	int	status;
	int	chan;
	$DESCRIPTOR(TERM,"SYS$COMMAND");

	status = sys$assign(&TERM, &chan, 0, 0);
	if (status != SS$_NORMAL) exit(status);
	status = smg$create_pasteboard(&new_pid,0,0,0,0);
	if (status != SS$_NORMAL) exit(status);
	status = smg$create_virtual_keyboard(&new_kid,&TERM,0,0);
	if (status != SS$_NORMAL) exit(status);
	status = smg$disable_unsolicited_input(&new_kid);
	if (status != SS$_NORMAL) exit(status);
...

The error message was "invalid pasteboard-id"

The fact that I get an invalid I/O channel error when I use the
routine as it is documented suggests that there is something wrong
with the routine.  However, I hestitate to put the blame on the run
time library.  Should this be SPRed or is it merely a user error?

Thanks in advance,
Joe Barone
{allegra, cci632, gatech, ihnp4, linus, mirror, raybed2}!rayssd!m1b
Raytheon Co, Submarine Signal Div., 1847 West Main Rd, Portsmouth, RI 02871

carl@CITHEX.CALTECH.EDU (Carl J Lydick) (07/26/86)

>   	Has anyone had any success with the SMG routine,
>   SMG$DISABLE_UNSOLICITED_INPUT in VAX C.  I'm running VMS V4.4
>   and C V2.2.  I tried the three permutations below and received
>   the noted error messages.  The first attempt is the way it is
>   documented in the RTL Part II (5D) reference manual.
>   
>   Attempt #1:
>   ...
>       	unsigned int	new_pid;
>       	int	status;
>   
>       	status = smg$create_pasteboard(&new_pid,0,0,0,0);
>       	if (status != SS$_NORMAL) exit(status);
>       	status = smg$disable_unsolicited_input(&new_pid);
>       	if (status != SS$_NORMAL) exit(status);

You've almost got it there.  The only problem is you're trying to disable
something that isn't already enabled.  What you need to do is have something
like:
		if ((status = smg$enable_unsolicited_input(&new_pid, kbdattn,
		     	new_pid)) != SS$_NORMAL) exit(status);
between the creation of the pasteboard and the call to
smg$disable_unsolicited_input, with kbdattn the address of a routine to
service the ast's.