home *** CD-ROM | disk | FTP | other *** search
- Path: academy.bastad.se!news
- From: sten@academy.bastad.se (Sten Jansson)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Message port
- Date: 28 Feb 1996 19:39:41 GMT
- Organization: Connection Bastad
- Message-ID: <708.6632T987T2426@academy.bastad.se>
- NNTP-Posting-Host: academy.bastad.se
- Mime-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
- X-Newsreader: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*
-
- I've tried to create a message-port in a simple test-program. It works,
- ,but as soon as I start another program the message-port disappear.
- Here is my program:
- --
- void AddportT(struct MsgPort * MP)
- {
- int SIGBIT;
-
- if((SIGBIT=AllocSignal(-1L))==-1)
- exit(0);
-
- MP= AllocMem(sizeof(struct MsgPort),MEMF_PUBLIC|MEMF_CLEAR);
- if(!MP)
- {
- printf("Kunde inte allockera minne f÷r MsgPort\n");
- exit(1);
- }
-
- MP->mp_Node.ln_Name="WF";
- MP->mp_Node.ln_Pri=-125;
- MP->mp_Node.ln_Type=NT_MSGPORT;
-
- MP->mp_Flags=PA_SIGNAL;
- MP->mp_SigBit=SIGBIT;
- MP->mp_SigTask=(struct Task*)FindTask(0);
-
- AddPort(MP);
- }
- --
-
- Please help me if You know what's wrong! Maybe I should use some
- special compiler directives?
-
- /Sten
-
-