I use the following code:
WMPEqualizerSettingsCtrl eq = null;
eq.enhancedAudio = true;
But I get an error:
Object reference not set to an instance of an object.
I use the following code:
WMPEqualizerSettingsCtrl eq = null;
eq.enhancedAudio = true;
But I get an error:
Object reference not set to an instance of an object.
Yes, you've set the
eq
object equal tonull
when declaring it. That is what produces the exception: you can't set the properties of an object that doesn't exist!If you want to create an instance of the
WMPEqualizerSettingsCtrl
class, just usenew
:I don't know exactly what the
WMPEqualizerSettingsCtrl
class is, but you might need to pass some parameters to the constructor. Those provide the class with additional information about exactly how you want it to be created.