Copyright © 2006-2018 MultiMedia Soft

CallbackDeviceChangeSet method

Previous pageReturn to chapter overviewNext page



Sets a callback for receiving notification whenever the system default multimedia input/output device (sound card) is changed through the Windows Control Panel's multimedia settings or when a new USB device is plugged or unplugged.


This method is only intended for usage with Windows XP and earlier versions. When dealing with Windows Vista and higher versions it's recommended using the CallbackForCoreAudioEvents callback.





[Visual Basic]

Public Function CallbackDeviceChangeSet (

function as CallbackDeviceChange

) as enumErrorCodes



public enumErrorCodes CallbackDeviceChangeSet (

CallbackDeviceChange function




public: enumErrorCodes CallbackDeviceChangeSet (

CallbackDeviceChange function









Pointer to the callback function that will receive the event. Remember that callback functions must be as fast as possible in order to avoid slowing down overall performances.



when using the API from Unmanaged C++ through COM interaction, where the client application is totally unaware about .NET delegates, you should use the "Ptr" version of the method which allows passing the pointer to the callback function:


[Unmanaged C++]

enumErrorCodes CallbackDeviceChangeSetPtr (

(UINT_PTR) functionPointer








Pointer to the callback function.

See the Adding the API to an unmanaged Visual C++ project tutorial for details about usage of the "Ptr" version of these methods.


Return value






Negative value

An error occurred. Check the LastError property value in order to see the last error.

enumErrorCodes.ERR_NOERROR (0)

The method call was successful.