beautypg.com

Apple AppleShare 3.0 File Server Controls User Manual

Page 24

background image

This section describes the server control call that lets you send messages to

users.

SCSendMessage

The following function calls SCSendMessage to send a message to the users

specified in the array pointed to by DiscArrayPtr.

Note This call is not supported by Macintosh File Sharing.

FUNCTION MySCSendMessage (DiscArrayPtr: LongIntPtr;

ArrayCount: Integer;

Flags: Integer;

MessagePtr: StringPtr): OSErr;

VAR

scPB: SCParamBlockRec;

BEGIN

scPB.disconnectPB.scDiscArrayPtr := DiscArrayPtr;

scPB.disconnectPB.scArrayCount := ArrayCount;

scPB.disconnectPB.scCode := SCSendMessage;

scPB.disconnectPB.scFlags := Flags;

scPB.disconnectPB.scMessagePtr := MessagePtr;

MySCSendMessage := SyncServerDispatch(@scPB);

END;

The following procedure sends a message to all connected users. Before using

this routine, you must initialize gCurMaxSession by using the SCGetSetupInfo

call.

PROCEDURE SendMessageToAll;

{ This routine depends on gCurMaxSessions being }

{ initialized with SCGetSetupInfo. }

VAR

err: OSErr;

ArrayPosPtr: LongIntPtr;

Position: LongInt;

scPB: SCParamBlockRec;