NullReferenceException
-
my program is working fine everywhere except one vista home premium client pc. there it shows "NullReferenceException : object reference not set to ..................." if any one can give some clue where could be the problem or any information if required from me? the relevant code is below: cLock = new ClsHasp(); bLock = cLock.gfCheckLock(); cLock is class variable of my FrmMain and is an object of class ClsHasp, and contains a function public bool gfCheckLock(), bLock is obviously bool type. error is in second line only 1 of several client pcs. thanking you in anticipation.
manoj sharma 09313603665 manoj.great@yahoo.com
-
my program is working fine everywhere except one vista home premium client pc. there it shows "NullReferenceException : object reference not set to ..................." if any one can give some clue where could be the problem or any information if required from me? the relevant code is below: cLock = new ClsHasp(); bLock = cLock.gfCheckLock(); cLock is class variable of my FrmMain and is an object of class ClsHasp, and contains a function public bool gfCheckLock(), bLock is obviously bool type. error is in second line only 1 of several client pcs. thanking you in anticipation.
manoj sharma 09313603665 manoj.great@yahoo.com
Check the method
gfCheckLock()
there might be a variable/object in there that gives the error. Or it might just be in the constructor of the ClsHasp if there are objects/variables creates/initialized in there. good luck.V. If I don't see you in this world, I'll see you in the next one... And don't be late. (Jimi Hendrix)
-
my program is working fine everywhere except one vista home premium client pc. there it shows "NullReferenceException : object reference not set to ..................." if any one can give some clue where could be the problem or any information if required from me? the relevant code is below: cLock = new ClsHasp(); bLock = cLock.gfCheckLock(); cLock is class variable of my FrmMain and is an object of class ClsHasp, and contains a function public bool gfCheckLock(), bLock is obviously bool type. error is in second line only 1 of several client pcs. thanking you in anticipation.
manoj sharma 09313603665 manoj.great@yahoo.com
What's happening in gfCheckLock()? If it's a null reference exception you're probably not instantiating something. Does the app call an external resource that the single client machine doesn't have perhaps? Are the other machines also running the same OS?
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson
-
Check the method
gfCheckLock()
there might be a variable/object in there that gives the error. Or it might just be in the constructor of the ClsHasp if there are objects/variables creates/initialized in there. good luck.V. If I don't see you in this world, I'll see you in the next one... And don't be late. (Jimi Hendrix)
class ClsHasp { private int seed; private int lptNum; private int passw1; private int passw2; public ClsHasp() { seed = 0; lptNum = 0; passw1 = 0; passw2 = 0; } public bool gfCheckLock() { try { System.Windows.Forms.MessageBox.Show("1"); =============== i m trying above in gfCheckLock(), even before any statement i m displaying a message, then also the same exception?? any ideas??
manoj sharma 09313603665 manoj.great@yahoo.com
-
What's happening in gfCheckLock()? If it's a null reference exception you're probably not instantiating something. Does the app call an external resource that the single client machine doesn't have perhaps? Are the other machines also running the same OS?
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson
class ClsHasp { private int seed; private int lptNum; private int passw1; private int passw2; public ClsHasp() { seed = 0; lptNum = 0; passw1 = 0; passw2 = 0; } public bool gfCheckLock() { try { System.Windows.Forms.MessageBox.Show("1"); =============== i m trying above in gfCheckLock(), even before any statement i m displaying a message, then also the same exception?? any ideas?? as for the OS develop machine is win2k3, clients are xp as well as vista.
manoj sharma 09313603665 manoj.great@yahoo.com
-
class ClsHasp { private int seed; private int lptNum; private int passw1; private int passw2; public ClsHasp() { seed = 0; lptNum = 0; passw1 = 0; passw2 = 0; } public bool gfCheckLock() { try { System.Windows.Forms.MessageBox.Show("1"); =============== i m trying above in gfCheckLock(), even before any statement i m displaying a message, then also the same exception?? any ideas??
manoj sharma 09313603665 manoj.great@yahoo.com
-
Could be, not so long ago I had the same problem and tried to debug with messageboxes, they never showed either, but still the code was further down the line, so yes. Comment out all lines in gfCheckLock and do a
return true
.V. No hurries, no worries
thanx. i tried the same. this time its working(how?) but need to do the stuff inside.
manoj sharma 09313603665 manoj.great@yahoo.com
-
thanx. i tried the same. this time its working(how?) but need to do the stuff inside.
manoj sharma 09313603665 manoj.great@yahoo.com
So check the code that you replaced, the bug is in there somewhere.
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview Archive -
So check the code that you replaced, the bug is in there somewhere.
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview Archiveas u can see above very first line of message doesn't get displayed. so what could b wrong?
manoj sharma 09313603665 manoj.great@yahoo.com
-
as u can see above very first line of message doesn't get displayed. so what could b wrong?
manoj sharma 09313603665 manoj.great@yahoo.com
How the hell should I know? Somewhere in the code you just replaced some variable or object hasn't been initialized... If you want help, please be more specific, I can't tell what you're doing if you don't elaborate on it more. I didn't develop that piece of code you know. I suggest you try to do some debugging or something.
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview Archive -
How the hell should I know? Somewhere in the code you just replaced some variable or object hasn't been initialized... If you want help, please be more specific, I can't tell what you're doing if you don't elaborate on it more. I didn't develop that piece of code you know. I suggest you try to do some debugging or something.
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview Archiveplease dont don't get it wrong? code is not giving problem everywhere?? it is running fine everywhere else. but on 1 pc only this is the error. so i guess it's not related to code but something other than that. that's why i need experts viewes. to start debugging on that client machine (i cant use debugger as no source code is there no vs2k5 is there) i m creating exe here, sending it client and then i came to know the results. that's why i m giving message. return true suggested by you works, but instead first line of messagebox doesn't come up only that single machine. hope this cools you down. any ideas??
manoj sharma 09313603665 manoj.great@yahoo.com
-
please dont don't get it wrong? code is not giving problem everywhere?? it is running fine everywhere else. but on 1 pc only this is the error. so i guess it's not related to code but something other than that. that's why i need experts viewes. to start debugging on that client machine (i cant use debugger as no source code is there no vs2k5 is there) i m creating exe here, sending it client and then i came to know the results. that's why i m giving message. return true suggested by you works, but instead first line of messagebox doesn't come up only that single machine. hope this cools you down. any ideas??
manoj sharma 09313603665 manoj.great@yahoo.com
Dude, It's not a question of cooling down or not, I can't help you without information. What's the contents of that specific function? It could be that it's machine related, like an unregistered dll, a setting, a missing file, etc, but it could be code. Can you write to a log file? Put some lines in the function and see what it does. You could also try to add beeps if all else fails.
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview Archive