home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Object reference not set to an instance of an object
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="fripsy" data-source="post: 683170" data-attributes="member: 85604"><p>Hi All,</p><p></p><p>I'm pulling my hair out with this one! </p><p></p><p>I have this declared:</p><p>[code]</p><p> [SkinControlAttribute(201)]</p><p> protected GUIButtonControl btnStatus = null;</p><p>[/code]When I use in my code:</p><p></p><p>[code]</p><p> btnStatus.Label = "Test";</p><p>[/code]I get "Object reference not set to an instance of an object" in the Mediaportal.log</p><p>I'm sure this has worked before, the only change I can remember is the upgrade from MP1.1.0 to 1.1.1... I think...</p><p>This means that "btnStatus" is null at the moment I try to use it, which makes sense as I can't find where it gets binded with the GUIButton with id 201. Should MP bind this for me at the start of my plugin or do I have to do this myself?</p><p>If I have to bind it myself, how do I do that?</p><p></p><p>On another thread I found this</p><p>[code]</p><p>[SkinControlAttribute(1)]</p><p> protected GUILabelControl lblText = (GUILabelControl)GetControl(1); [/code]But this gives me "Error 1 An object reference is required for the non-static field, method, or property 'MediaPortal.GUI.Library.GUIWindow.GetControl(int)'" in Visual C Express...</p><p></p><p>Could someone enlighten me on this one?</p><p></p><p>Thanks,</p><p>Fripsy.</p></blockquote><p></p>
[QUOTE="fripsy, post: 683170, member: 85604"] Hi All, I'm pulling my hair out with this one! I have this declared: [code] [SkinControlAttribute(201)] protected GUIButtonControl btnStatus = null; [/code]When I use in my code: [code] btnStatus.Label = "Test"; [/code]I get "Object reference not set to an instance of an object" in the Mediaportal.log I'm sure this has worked before, the only change I can remember is the upgrade from MP1.1.0 to 1.1.1... I think... This means that "btnStatus" is null at the moment I try to use it, which makes sense as I can't find where it gets binded with the GUIButton with id 201. Should MP bind this for me at the start of my plugin or do I have to do this myself? If I have to bind it myself, how do I do that? On another thread I found this [code] [SkinControlAttribute(1)] protected GUILabelControl lblText = (GUILabelControl)GetControl(1); [/code]But this gives me "Error 1 An object reference is required for the non-static field, method, or property 'MediaPortal.GUI.Library.GUIWindow.GetControl(int)'" in Visual C Express... Could someone enlighten me on this one? Thanks, Fripsy. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Object reference not set to an instance of an object
Contact us
RSS
Top
Bottom