Copyright © 2005-2016 MultiMedia Soft

OnDownloaderEvents event

Previous pageReturn to chapter overviewNext page

Remarks

 

Occurs during a downloading session performed through the DownloaderDj class.

 

This event replaces the usage of the CallbackForDownloaderEvents delegate and is only intended for usage with applications developed using Visual Basic 6 (which results unreliable when dealing with delegates and callbacks) and, in order to be enabled, requires a call to the COMEventsEnable method.

 

For further details about callback delegates see the How to synchronize the container application with the API 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 6]

Private Sub DjStudioApi_OnDownloaderEvents ( _

ByVal nEvent as enumDownloaderEvents, _

ByVal nDllSessionUniqueId as Int32, _

ByVal nParam1 as Int32, _

ByVal nParam2 as Int32, _

ByVal nParam3 as Int32 _

)

 

where "DjStudioApi" is declared in Visual Basic 6 code as:

 

Dim WithEvents DjStudioApi As AudioDjStudioApi.AudioDjStudioApiObj


 

 

Event Data

 

Parameter

Description

 

 

nEvent

The type of event.

Supported values, with related parameters, are the following:

Mnemonic constant

Value

Meaning

EV_DOWNLOADER_SESSION_COMPLETED

1

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

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

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

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

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

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)