Usenet comp.sys.vms (1990-2004)
 help / color / mirror / Atom feed
From: vli@mpr.ca (Vincent Li)
Subject: Create & QIO to DECterms
Date: Tue, 22 Jun 1993 16:41:05 GMT	[thread overview]
Message-ID: <1993Jun22.164105.23968@mprgate.mpr.ca> (raw)

Greetings folks,
   Question: how does one do QIO to a DECterm created from an application?

   Background:
    I've followed the examples in the VMS DECwindows application programming
guide, appendix A on the use of DECwTermPort to create a DECterm. Fine, no
problem. Now, my application which makes the call to DECwTermPort wants to
do QIO (read/write) to this newly created terminal, but I can't seem to
assign a channel to the device. I get Access Violation status from the
assign. Is there a way to get around it?
    I am not sure if I can do a $creprc as in the example to get around the
problem. I would like to have the application which create the DECterm to
process the input/output and have control of the terminal device. (eg. user
issue command from the application to kill the terminal, which leads to
another question: how does one destroy a terminal device thus created? (FTAn:)
    Is there a better way?

Here's the code fragment I used to create & assign the channel:
------------------------------------------------------------
short device_length;
char device_name[50];
$uword user_input_chan;
$uword user_output_chan;

$DESCRIPTOR(terminal, "");
char buffer[256];
struct {
    $uword cond_value;
    $uword count;
    int    dev_info;
} iosb;

    int status, stsflg;

    tnmxuip_set_cursor(display, XtWindow(toplevel_w), TNMXUI_CSR_BUSY);

    /* send message to the controller */
    status = DECwTermPort(0, 0, 0, device_name, &device_length);
    if (status != SS$_NORMAL) {
        printf("DECterm creation failed, status is %x\n", status);
        goto done;
    }

    terminal.dsc$w_length = device_length;
    terminal.dsc$a_pointer = device_name;
    status = sys$assign(terminal, &user_input_chan, 0, 0);
    if (status != SS$_NORMAL) {
        printf("Could not assign input channel, status is %x\n", status);
        if (status == SS$_ACCVIO)
            printf("Access violation\n");
         is %x\n", status);
        goto done;
    }

    status = sys$assign(terminal, &user_output_chan, 0, 0);
    if (status != SS$_NORMAL) {
        printf("Could not assign output channel, status is %x\n", status);
        goto done;
    }

    sprintf(buffer, "This is a test output\n");
    status = sys$qiow(3, user_output_chan, IO$_WRITEVBLK, &iosb,
                      0, 0, buffer, 23);
done: tnmxuip_set_cursor(display, XtWindow(toplevel_w), TNMXUI_CSR_DEFAULT);
    return;
}

Thanks!

-- Vince

---------------------------------------
vli@mprgate.mpr.ca        |-) It works well under pressure: Another thing
                          |-] you can say about your pillow. -- Mr Boffo


             reply	other threads:[~1993-06-22 16:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-06-22 16:41 Vincent Li [this message]
1993-06-22 19:14 ` Create & QIO to DECterms Fred Kleinsorge
1993-06-23 12:19   ` Ron Fox
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox