From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,7b947278c7c7d7cb,start X-Google-Attributes: gidf7344,public X-Google-Thread: fc7fa,7b947278c7c7d7cb,start X-Google-Attributes: gidfc7fa,public X-Google-ArrivalTime: 1993-06-22 09:58:39 PST Newsgroups: comp.sys.vms,comp.os.vms Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!math.ohio-state.edu!caen!destroyer!cs.ubc.ca!mprgate!vli From: vli@mpr.ca (Vincent Li) Subject: Create & QIO to DECterms Message-ID: <1993Jun22.164105.23968@mprgate.mpr.ca> Keywords: DECterm Sender: news@mprgate.mpr.ca Nntp-Posting-Host: atom Organization: MPR Teltech Ltd., Burnaby, B.C., Canada Date: Tue, 22 Jun 1993 16:41:05 GMT 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