CompuServe Messages

Saving window location

    14-Mar-94 02:40:49
Fm: Steve Stockman 76507,2646
To: Eric Long 72764,1072
Eric: >>> memcpy( tempStr, gNotifyStr, strlen(gNotifyStr) ); <<< First of all, note that the Notification Mgr wants pascal strings, and the above really looks like a C string. If it is, you need to CtoPStr() it. >>> err = NMInstall( (NMRecPtr) &myNote); RemoveQueue( &myNote ); … Can you please tell me why this *^&@# thing won't work! <<< All that NMInstall() does is put the message in a queue. But nothing will ever actually look at that queue until the next time someone calls WaitNextEvent() [or its relatives]. If the message has not yet made it to the screen, NMRemove() will prevent it from ever getting there; if the message is currently on the screen, NMRemove() will take it off without the user having to respond; if the user has already responded, NMRemove() just does cleanup. After you call NMInstall(), you then need to go do something else, such as sit in a WaitNextEvent() loop. You don't want to call NMRemove() until: 1) the user has responded, or 2) the condition you are alerting about has ceased to exist, or 3) you decide to time out because the computer is apparently unattended. Note however that both your NMRec and your message string are local variables in the routine where you call NMInstall(). If that routine returns before you call NMRemove(), the NMRec will cease to exist, and the Notification Mgr will crash. Also, if you set nmResp to -1, you should never call NMRemove(), because the Notification Mgr will remove it for you. However, this comes with the disadvantage of not knowing _when_ the user responded or the NMRemove() happened. Well, pretty much, anyway; you could call WaitNextEvent() immediately, and that would probably force things. >>> It even mentioned setting nmResp to NULIL. What the heck is NULIL? <<< A typo for NULL.