Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

i'm trying to add crossfade to items in a loaded playlist

 

 

Dim playereq As WMPLib.IWMPEqualizerSettingsCtrl

playereq.crossFade = True

 

this builds ok bt breaks with

 

"

An unhandled exception of type 'System.NullReferenceException' occurred in bs_playlists.exe

 

Additional information: Object reference not set to an instance of an object.

 

"

Can anyone help?

Posted

The object needs to be created if the function isn't Shared

Dim Playereq As New WMPLib.IWMPEqualizerSettingsCtrl 'Object Reference
Dim Playereq As WMPLib.IWMPEqualizerSettingsCtrl 'Nothing

.Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
Posted

thanks for the quick response

 

with that snippet (used in onformLoad)

 


'Object Reference
Dim Playereq As New WMPLib.IWMPEqualizerSettingsCtrl    
Playereq.crossFade = True

 

gives me : 'New' cannot be used on an interface.

 

 

 

I've also tried WMPLib.WMPEqualizerSettingsCtrl but wasnt sure what the differenece between IWMP and WMP

 

 

thanks

  • *Experts*
Posted

If it is prefixed with an "I" it means it is an interface. There is no real functionality to it; it's just a "shell" of a class that consists of the declarations of all of the properties and methods, but no code. In your case, you need to use the one without the "I" in front.

 

I suggest you read about polymorphism and other OOP concepts in your MSDN if you want to really understand it.

  • 11 months later...
  • 1 month later...
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...