Copyright © 2005-2018 MultiMedia Soft

CallbackForDownloaderEvents delegate

Previous pageReturn to chapter overviewNext page

Remarks

 

Callback delegate invoked during a downloading session performed through the DownloaderDj class: this callback can be set through a call to the CallbackForDownloaderEventsSet method.

 

For further details about callback delegates see the How to synchronize the container application through callback delegates tutorial.

For details about management of download sessions from HTTP and FTP servers, refer to the How to manage download sessions tutorial.

 

 

Syntax

 

[Visual Basic]

Public Delegate Sub CallbackForDownloaderEvents (

ByVal nEvent as enumDownloaderEvents,

ByVal nDllSessionUniqueId as Int32,

ByVal nParam1 as Int32,

ByVal nParam2 as Int32,

ByVal nParam3 as Int32

)


 

[C#]

public delegate void CallbackForDownloaderEvents (

enumDownloaderEvents nEvent,

Int32 nDllSessionUniqueId,

Int32 nParam1,

Int32 nParam2,

Int32 nParam3

)


 

[C++]

public delegate void CallbackForDownloaderEvents (

enumDownloaderEvents nEvent,

Int32 nDllSessionUniqueId,

Int32 nParam1,

Int32 nParam2,

Int32 nParam3

)


 

 

Parameter

Description

 

 

nEvent

The type of event.

Supported values, with related parameters, are the following:

Mnemonic constant

Value

Meaning

EV_DOWNLOADER_SESSION_COMPLETED

1

Alternative to the DownloaderSessionCompleted event.

Occurs at the end of a successful downloading session generated by a previous call to one between the Downloader.SessionStartToFile, Downloader.SessionStartToMemory and Downloader.SessionStartToPlayer methods.

 

Involved data parameters: none

EV_DOWNLOADER_SESSION_FAILED

2

Alternative to the DownloaderSessionFailed event.

Occurs in case of failure of a downloading session generated by a previous call to one between the Downloader.SessionStartToFile, Downloader.SessionStartToMemory and Downloader.SessionStartToPlayer.methods.

 

Involved data parameters:

nParam1: Error code generated by the component: see the LastError property for supported values

nParam2: Eventual error code defined inside the Windows SDK.

nParam3: In case the nDjErrorCode parameter should report an error of type ERR_DOWNLOADER_REMOTE_FILE_FAILURE or ERR_DOWNLOADER_LOCAL_FILE_FAILURE, this parameter reports the eventual file exception raised when accessing the remote or the local file.

Possible exception values can be seen on the table below:

Value

Meaning

1

An unspecified error occurred.

2

The file could not be located.

3

All or part of the path is invalid.

4

The permitted number of open files was exceeded.

5

The file could not be accessed.

6

There was an attempt to use an invalid file handle.

7

The current working directory cannot be removed.

8

There are no more directory entries.

9

There was an error trying to set the file pointer.

10

There was a hardware error.

11

SHARE.EXE was not loaded, or a shared region was locked.

12

There was an attempt to lock a region that was already locked.

13

The disk is full.

14

The end of file was reached.

EV_DOWNLOADER_SESSION_PROGRESS

3

Alternative to the DownloaderSessionCompleted event.

Occurs during a downloading session, generated by a previous call to one between the Downloader.SessionStartToFile, Downloader.SessionStartToMemory and Downloader.SessionStartToPlayer.methods, to notify the container application about the current advancement.

 

Involved data parameters:

nParam1: Advancement of the download session expressed in percentage

EV_DOWNLOADER_INVALID_FILE

4

Alternative to the DownloaderSessionInvalidFile event.

Occurs at the end of a successful downloading session, generated by a previous call to the Downloader.SessionStartToPlayer.method, when the player is unable to load the downloaded media file due to the fact that the format of the file itself is not supported.

 

Involved data parameters: none

EV_DOWNLOADER_SESSION_STARTED

5

Alternative to the DownloaderSessionStarted event.

Occurs at the beginning of a downloading session generated by a previous call to one between the Downloader.SessionStartToFile, Downloader.SessionStartToMemory and Downloader.SessionStartToPlayer.methods.

 

Involved data parameters: none

EV_DOWNLOADER_SESSION_STOPPED

6

Alternative to the DownloaderSessionStopped event.

Occurs when a downloading session, generated by a previous call to one between the Downloader.SessionStartToFile, Downloader.SessionStartToMemory and Downloader.SessionStartToPlayer.methods, is stopped through the Downloader.SessionStop method.

 

Involved data parameters: none

nDllSessionUniqueId

Unique identifier of the downloading session generated by a previous call to one between the Downloader.SessionStartToFile, Downloader.SessionStartToMemory and Downloader.SessionStartToPlayer.methods.

nParam1

Number representing the first parameter related to the event (see the events table above for details)

nParam2

Number representing the second parameter related to the event (see the events table above for details)

nParam3

Number representing the third parameter related to the event (see the events table above for details)