Carbon


URLSystemEventProcPtr

Header: URLAccess.h Carbon status: Supported

Defines a pointer to your system event notification callback. Your callback handles update events that occur while a dialog box is displayed during a data transfer operation.

typedef OSStatus(* URLSystemEventProcPtr) (
    void *userContext, 
    EventRecord *event
);

You would declare your function like this if you were to name it MyURLSystemEventCallback:

OSStatus MyURLSystemEventCallback (
    void *userContext, 
    EventRecord *event
);
Parameter descriptions
userContext

A pointer to application-defined storage that your application previously passed to the function URLSimpleDownload, URLDownload, URLSimpleUpload, or URLUpload. Your application can use this value to set up its context when the system event callback function is called.

event

A pointer to an event record containing information about the system event that occurred during the data transfer operation.

function result

A result code. Your system event callback function should process the system event and return noErr.

DISCUSSION

You pass a pointer to your callback function in the eventProc parameter of the function URLSimpleDownload, URLSimpleUpload, URLDownload, or URLUpload if you want update events to be passed to your application while a dialog box is displayed by these functions. (In Mac OS X, this is not necessary, since all dialog boxes are moveable). In order for these functions to display a dialog box, you must set the mask constant kURLDisplayProgressFlag or kURLDisplayAuthFlag in the bitmask passed in the openFlags parameter. Call the function NewURLSystemEventUPP to create a UPP to your system event notification callback. If you do not write your own system event notification callback, these functions will display a nonmovable modal dialog box.

When your callback is called, it should process the event immediately and return 0. You may wish your callback function to update its user interface, allocate and deallocate memory, or call the Thread Manager function NewThread.

SPECIAL CONSIDERATIONS

Do not call the function URLDisposeReference from your callback function. Doing so may cause your application to stop working.


© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)