c# - Winforms Null Reference Exception -
at moment trying open first video file in winform application using this vlc library
as far can tell, have set properly. have followed of source code sample projects give , created winform in style of sample project. when run project , open file, null reference exception
on following code, namely line vlccontrol.media = media;
:
if (openfiledialog.showdialog(this) == dialogresult.ok) { var media = new pathmedia(openfiledialog.filename); vlccontrol.media = media; }
i know null reference errors happen because haven't initialized something, eyes, media has been set new object. why compiler throwing fit?
update i've fixed issue. had rebuild , re-add dll had fix issue. thank help.
there 2 options cause this.
vlccontrol
null (hasn't been constructed or initialized) @ point. cause exception occur since you're trying accessmedia
property.vlccontrol
raising exception because it's internal state not setup properly. if settingmedia
property causes code run internally, , state not setup properly, can raise exception.
you should able @ exception details or locals window (to check vlccontrol
being null
) determine problem lies.
Comments
Post a Comment