[comp.sys.amiga.tech] DOS Windows on custom screens

edwin@hcr.UUCP (Edwin Hoogerbeets) (01/04/89)

Hello, people. 

I have been trying to make a window on a custom screen from which I can
do input and output. I looked in the Intuition manual, and it said this:

I should create a IOStdReq structure and initialize the io_Data field
with a pointer to the window I have just created on my new screen. Then,
you OpenDevice("console.device",1,myIOStdReq,NULL) to automatically have
all the other fields filled in.

Then, to write something to the window, you set
myIOStdReq.io_Data = "my output string";
myIOStdReq.io_Command = CMD_WRITE;
myIOStdReq.io_Length = 16;

and do a DoIO(myIOStdReq). This works fine.

If I follow the directions to read, then the task freezes. The rest of
the tasks are fine and operate as they should. (Deadlock?)

Question 1: what I am doing wrong here? 
(I can't find the RKM's in the stores anymore, so I can't look it up. I
am mainly working from Rob Peck's book, which isn't really a tutorial as
the RKM's are. Great for reference though, Rob!)

I eventually gave up on this method, and looked through my Fish
collection for examples of DOS windows. I came across "window" by Andy
Finkel, (Fish 38) which provided a method of opening a DOS handle from
my window. Great! I compiled his source (changing the Execute("format
<* >* ...") to Execute("shell <* >*") ) and it worked beautifully,
although it was funny seeing Matt's shell running in 60 column mode.
;-)

The problem is, when I inserted the appropriate stuff into my own code, I
started getting different return codes from the NewConsole() function
he provides. Specifically, I am getting zero, zip, NULL, no task
started.

Question 2: (Andy, if you are reading:) What does this mean? What are
the possible circumstances that I could get this result? (the docs are
minimal) Anyone? How do I read from a window???? [20 marks]

Hardware: 2000 with 1.5 Megs, 1 of which is half-fassed-RAM, Kickstart
1.2, WB 1.3 (finally, yeah!)

Side topic:

Remember last summer, when I said I would put together an intro
posting?  Well, when I got back to school in September, I found that
they didn't really want me posting things off campus. So, now that I am
back at work for another 4 months, I shall organize the material I have
collected and post something sometime this week. If anyone has anything
to add, I would be glad to include it. Sorry for the delay. (Has anyone
else done anything on it??)

Thanks for any help you can give.

------     *     ---------     =    ------------------------------------------  
name : Edwin (Deepthot) Hoogerbeets     Co-op student, HCR Corporation
smart: edwin@hcr.uucp                   In math, if the conjecture passes
dumb : uunet!utai!utcsri!hcr!edwin      the University Senate, *then* it 
					becomes a theorem.