object-reference

Is there an expandable list of object references in Java?

In Java, we can always use an array to store object reference. Then we have an ArrayList or HashTable which is automatically expandable to store objects. But does anyone know a native way to have an auto-expandable array of object references? Edit: What I mean is I want to know if the Java API has some class with the ability to store re...

Is there a good way to perform WPF/C# object dereferencing, for garbage collection?

Application Background Our platform is a click-once WPF application. We have a "shell" that contains a navigation menu structure and it hosts our own custom "page" classes. When you navigate to a new page, we swap out the content of the shell (essentially). Problem So, I work for a company that is working on a extremely large softwar...

Object Instance in C#

Hi, Why do I get "Object Reference Not Set to Instance of an Object" protected void GetData() { ... id = this.GetTabControl().ID; //<---------here } ... protected ASPxPageControl GetTabControl() { return (ASPxPageControl)this.FindControl("DetailTab"); } ---------I assume the FindControl is not working. ...

Custom AS3 class is null after being added to Array

I'm a C# developer who is trying to learn some AS3, so this is going to be a pretty newbie question. I'm getting confused with regards to scope and GC, as I have a custom MovieClip-extending class (Slide) which I create instances of within a loop and push() into an Array, but afterwards the items are null when I pull them out of the col...

Why am I losing object references on the postback?

I am developing an asp.net (3.5) application and I am puzzled with the behavior of the postbacks. Consider the following scenario: I have a web user control that is basically a form. However each form field is a web user control in itself. In the click event of the save button I iterate through all controls in my form and I retrieve t...

LINQ DataContext.SubmitChanges() in C# Reporting "Object reference not set to an instance of an object."

Hi. I think a lot of people have had this issue but I'm not able to fix it or understand why I'm having it. I've been tearing hair out for a couple of hours now. I'm getting the error, "Object reference not set to an instance of an object." on my datacontext.SubmitChanges() on the SECOND time this method runs (I'm looping through a ...

Why Does List Argument in Python Behave Like ByRef?

This may be for most languages in general, but I'm not sure. I'm a beginner at Python and have always worked on copies of lists in C# and VB. But in Python whenever I pass a list as an argument and enumerate through using a "for i in range," and then change the value of the list argument, the input values actually changes the original ...

.NET XmlSerializer and multiple references to the same object

My repository has List<Student>, List<Course> and List<Enrolment> where an Enrolment has Enrolment.Student and Enrolment.Course which are references one of the students or courses in the two previous lists. When I use XmlSerializer on my repository it outputs redundant data as it serializes all properties of each student in List<Stude...

object reference is not set to an instance of an object repository

I am getting an XAMLParseException that is really covering up another exception. Here is part of the stacktrace: Message=Object reference not set to an instance of an object. Source=AssignmentOrganizer StackTrace: at AssignmentOrganizer.MainWindow..ctor() in C:\Users\Mohit\Documents\Visual Studi...

Why would this event handler code cause a Object reference not set to an instance of an object. Error (only present on live server, ok on dev) ?

Here is the code for the button click event; Protected Sub CompetenciesButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CompetenciesButton.Click Dim con As String = WebConfigurationManager.ConnectionStrings("foo").ToString() Dim selectedrow As String = Competencies.SelectedValue.ToString ...

PHP Object References in Frameworks

Before I dive into the disscusion part a quick question; Is there a method to determine if a variable is a reference to another variable/object? (Just want to check I am passing references around correctly and not make duplicate versions of my objects). For example $foo = 'Hello World'; $bar = &$foo; echo (is_reference($bar) ? 'Is refe...

NullReferenceExeption when reading from a file

I need to read a file structured like this: 01000 00030 00500 03000 00020 And put it in an array like this: int[,] iMap = new int[iMapHeight, iMapWidth] { {0, 1, 0, 0, 0}, {0, 0, 0, 3, 0}, {0, 0, 5, 0, 0}, {0, 3, 0, 0, 0}, {0, 0, 0, 2, 0}, }; Hopefully you see what I'm trying to do here. I was confused how to do this so I asked her...

VB.NET - Object reference not set to an instance of an object

I need some help with my program. I get this error when I run my VB.NET program with a custom DayView control. ***** Exception Text ******* System.NullReferenceException: Object reference not set to an instance of an object. at SeaCow.Main.DayView1_ResolveAppointments(Object sender, ResolveAppointmentsEventArgs args) in C:\Us...

Null check always returns null, if removed returns Object reference not set to an instance of an object.

I have some code which gets child items for a menu via the GetChildren function which takes a list of menuData: Dim builtMenu As New List(Of MenuData)(_rawData.FindAll(Function(item) item.GroupingID = 0)) For Each menuData As MenuData In builtMenu If menuData.Children IsNot Nothing Then menuData.Children.AddRan...

How to check a "NULL object reference" in Managed C++ ?

Hi there, I come across some MC++ code like this: __gc class ClassA { Puclic: ClassB GetClassB(); } __gc class ClassB { Public: int Value; } int main() { ClassA^ a = gcnew ClassA(); ClassB^ b = a->GetClassB(); int c = b->Value; } Isn't it important to check whether b is NULL before access to its value? I trie...

My application works perfectly local but not in the remote server

When I upload the files on the remote server I get the following message: Object reference not set to an instance of an object And a few errors supposed to be happening in the ClassDesigner file and other few classes... I need help urgently please. What do you think is going on? Thank you! ...

How to embed object reference in HTML?

I created some HTML code based on a javascript var. I want to update these HTML code when I update the source var. Because I have object reference in the HTML, I know which HTML section to update. How do I accomplish such thing? Thank you. ...

In PHP, when foo = new Foo(), technically speaking, is foo an object, or is foo a reference?

Update: in http://php.net/manual/en/language.oop5.references.php it says: One of the key-points of PHP5 OOP that is often mentioned is that "objects are passed by references by default". This is not completely true. Why is that? The following is a reason which I don't know is completely true or not: I think loosely ...

ASP.NET MVC Object reference not set to an instance of an object

I saw a similar question here on SO but I believe mine differs a little a bit. OK, so I have a simple view here: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<RootFinder.Models.QuadCalc>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Po...