Questions tagged [object-reference]

An Object reference is a pointer to an object stored in memory. The main difference is that the object was previously created (via a new operator, for instance) and its reference is kept via an additional variable, that is, its object reference.

An Object reference is a pointer to an object stored in memory. The main difference is that the object was previously created (via a new operator, for instance) and its reference is kept via an additional variable, that is, its object reference.

More Info

325 questions
0
votes
2 answers

Controlling a spawned Thread from multiple activities in Android

I have an application that runs a background thread which periodically performs a task. The UI thread moves through several different activities. The tutorial I used can be found at this blog, the gist of it is the following: Create a class that…
pberlijn
  • 103
  • 2
0
votes
1 answer

mvc3 Object reference not set to an instance of an object, cant figure this out

I am getting an error of Object reference not set to an instance of an object I have tried multiple things but keep getting that error, the error is occuring on this line of code @if(!string.IsNullOrWhiteSpace(Model.profile.photo)) { …
user1591668
  • 2,591
  • 5
  • 41
  • 84
0
votes
1 answer

Reference xaml object from another xaml's codebehind?

I have to set a dynamic datapager PageSize depending on the ActualHeight of a grid that "includes" the xaml I am working on. I need to access this Grid from the included XAML's codebehind, and I keep getting "object reference required" errors. Here…
SylvainB
  • 4,765
  • 2
  • 26
  • 39
0
votes
2 answers

An object reference is required for the non-static field, method, or property error on new EventHandler

I know that this topic is shown everywhere on SO, but I couldn't find anything specific to this. I have a class that is used to store all my created windows for my application. What I am trying to do is create a new window, if one does not exist,…
Seb
  • 3,414
  • 10
  • 73
  • 106
0
votes
1 answer

How to check at runtime if an object is currently being used by the application, or has been garbage-collected?

The question pretty much says it all. Somewhere in my code i instantiated an object ObjectX with the new keyword. Now ObjectX is an expensive one in terms of memory and other resources. I need a means to check at runtime whether ObjectX is currently…
atiyar
  • 7,762
  • 6
  • 34
  • 75
0
votes
2 answers

Object reference not set to an instance of an object

That's my code: Dim num as integer = 0 For Each s As String In ListBox1.Items num = num + 1 Dim web(num) As WebBrowser RefreshIESettings(s) Web(num).Navigate("http://www.google.com") 'There's the error …
0
votes
2 answers

How to handle null value?

I am writing one LINQ to select data from entity. I have list of data with different attributes. One of the attribute could be null. so when it get null it giving me an below error Error: Object reference not set to instance of an object Here is…
user968441
  • 1,471
  • 9
  • 22
  • 48
0
votes
2 answers

How to Redirect or Close Browser after Session TimeOut in ASP.NET?

I have a Catcha value( Security Code ) that is store in Session on PageLoad and that is going to be used when user clicks the search button. If the User is IDLE for more than 20 Min the value of Session is get expired. And when user clicks on Search…
SHEKHAR SHETE
  • 5,964
  • 15
  • 85
  • 143
0
votes
2 answers

XML RunTime Error / Object reference not set to an instance of an object. (Using C#)

I am looking for a wise wizard to point me in the right direction. I am making a mock comic database using XML and C#. Everything works splendidly except for my edit page. On my localhost I get an Object Reference error, on my host I get a runtime…
Laura Mabee
  • 51
  • 2
  • 10
-1
votes
3 answers

C# Replace is causing Object Reference Not Found error

using "Replace" on the string clientNameStr causes an "Object Reference Not Found" error. // Get client name clientName = currentUser.GetValue("ClientName"); string clientNameStr = (string)clientName; string clientURLStr = string.Empty; clientURLStr…
Sinister Beard
  • 3,570
  • 12
  • 59
  • 95
-1
votes
2 answers

javascript - String to real Object

I have a javascript objects var flower_1; var flower_2; My question is if I have another variable for example a String var Name; And lets say for example: Name = "flower_1"; How can I change the Name variable into an object "flower_1"
BorisD
  • 2,231
  • 5
  • 25
  • 35
-1
votes
4 answers

Java Object Reference and Java Methods

I am unable to understand how this works public void addToRule(Rule r) { if (!getRuleList().contains(r)) { getRuleList().addElement(r); } } If I run this code: obj.addToRule(r); System.out.println(getRuleList().contains(r)); it…
MozenRath
  • 9,652
  • 13
  • 61
  • 104
-1
votes
7 answers

Object reference not set to an instance of an object... Error while using foreach

Possible Duplicate: What is a NullReferenceException in .NET? I am developing a simple program. Accepting an arraylist from Form1 and displaying its contents on form2 and I am getting this error.. Plz enlighten me.. Coding goes like this…
-1
votes
1 answer

Using to get PS script name from a C# DLL? Getting "Object reference not set to an instance of an object."

ERROR: Object reference not set to an instance of an object. I'm trying to create a DLL that can get the Entrypoint application name that is written in Powershell. The layout is very simple: In Powershell I add the…
John
  • 9
  • 1
-1
votes
1 answer

Javascript calling object property within the same object

I have an object as follows: let utx = module.exports = { params: { icon1: 'some value', icon2: 'some value', type1: { messages: { accept: { status: utx.params.icon1 } …
lordZ3d
  • 540
  • 6
  • 20