Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!ogicse!oregon!jmeissen From: jmeissen@oregon.oacis.org (John Meissen) Newsgroups: comp.sys.amiga Subject: Re: Problem with CreateProc & LoadSeg Message-ID: <474@oregon.oacis.org> Date: 4 May 90 16:24:17 GMT References: <897@tau.sm.luth.se> Organization: Oregon Advanced Computing Institute (OACIS), Beaverton, OR Lines: 33 In article <897@tau.sm.luth.se> Karl-Gunnar Hultland writes: >The problem is : >If I comment away the LoadSeg and CreateProc and start the program >Proc.c via a different CLI it works Like a Dream. BUT if I use the >code in Main.c I never get the window to open. >I have verifyed with Xoper that the process exists but doesn't open >the window and thus it can't exit. The problem may actually be related to the difference in the way that Workbench and CLI start processes. With the CLI, the new code is called as a subroutine (sort-of), and so the code is expected to fall right into executing. With WorkBench, the process is spawned as a seperate task, and is expected to wait for a message from Workbench with the arguments. These two diverse startup procedures are normally handled transparently in the C startup routine. In the case of Lattice (and this was the way recommended by Amiga way back when) the choice is made on the basis of whether or not the CLI sub-structure is present in the process structure. i.e., if the CLI structure pointer is non-NULL, get the argument pointer from the appropriate address register and continue executing. If it is NULL, wait on the msgport in the process structure for the Workbench message (which has to be returned at the end of execution). Now the problem you face is that CreateProc doesn't create a CLI sub-structure, so your code will think it's being spawned by Workbench and will wait for the Workbench message. It's probably either hung there, or that piece of the startup code ate your "hello" message and now it's waiting in the program for another message that will never come. -- John Meissen ............................... Oregon Advanced Computing Institute jmeissen@oacis.org (Internet) | "That's the remarkable thing about life; ..!sequent!oacis!jmeissen (UUCP) | things are never so bad that they can't jmeissen (BIX) | get worse." - Calvin & Hobbes