Xref: utzoo comp.sys.amiga:56493 comp.sys.amiga.tech:11705 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!snorkelwacker!bloom-beacon!eru!luth!d87-khd From: d87-khd@sm.luth.se (Karl-Gunnar Hultland) Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: Problem with CreateProc & LoadSeg Message-ID: <897@tau.sm.luth.se> Date: 4 May 90 15:12:33 GMT Reply-To: Karl-Gunnar Hultland Followup-To: comp.sys.amiga Organization: University of Lulea, Sweden Lines: 93 UUCP-Path: {uunet,mcvax}!sunic!sm.luth.se!d87-khd I have some sort of problem with an application I'm working on. I want to have a main program which should take care of menues etc and then upon command Load and Create some new processes who will open a window on the Custom screen and execute in that window. 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 question is: Is there ANYTHING I should do that I don't?? (code extracts follow .sig) Karl --- Karl Hultland,(d87-khd@sm.luth.se) University of Lulea,Sweden Egoist: a person of low taste, more interested in himself than in me. - A. Bierce ========================================================================= Main.c ========================================================================= handleMSG(n) int n; { if (segm1) UnLoadSeg(segm1); MenuOn(0); MenuOn(3); return 0; } Load(n,msg,str) int n; struct OLFMessage *msg; STRPTR str; { MenuOff(0); MenuOff(3); segm1=LoadSeg(str); proc1=CreateProc(str,0,segm1,4000); mesg1->Msg.mn_Node.ln_Type = NT_MESSAGE; mesg1->Msg.mn_Length=sizeof(struct OLFMessage); mesg1->Msg.mn_ReplyPort=OLFr; mesg1->Code=HELLO; mesg1->From=MAIN; mesg1->To=TEST; mesg1->scr=myscr; SafePutToPort( (struct Message *) mesg1,"OLF"); return 0; } ========================================================================= Proc.c ========================================================================= do { msg=WaitForMsg("OLF",HELLO,TEST); /* Wait for WELCOME message */ } while (msg==NULL); scr=msg->scr; /* Get address of screen */ TestWin.Screen=scr; win=OpenWindow(&TestWin); /* Open window on customscreen */ signalmask=1L << win->UserPort->mp_SigBit; while (!done){ /* Wait until closegadget is selected */ signals=Wait(signalmask); if (signals & signalmask) done=handleIDCMP(win); }; if (win) CloseWindow(win); if (GfxBase) CloseLibrary( (struct Library *) GfxBase); if (IntuitionBase) CloseLibrary((struct Library *) IntuitionBase); ReplyMsg( (struct Message *)msg ); }