NullReferenceException

E

elven byte

Hi everybody.

I'm making an application for a Symbol with keyboard, with Operating System
Windows Pocket PC 4.20, it has a keyboard incorporated (the one with the
rubber keyboard), and I'm making the application wit VB.NET with SP2
installed on it (it fixes some problems with this keyboard by the way).

Here you are the code piece with the exception handled:

Private Sub lstAccion_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles lstAccion.KeyDown
Try
If e.KeyData = Keys.Left Then
ButtonLeft_Click(sender, e)
End If

If e.KeyData = Keys.Right Then
ButtonRight_Click(sender, e)
End If

If e.KeyData = Keys.Enter Then
ButtonRight_Click(sender, e)
End If
Catch ex As NullReferenceException
MsgBox(ex.Message)
End Try
End Sub

The fact is that the line with the msgbox allways is executed, because the
exception raises, but in the other hand I've got another listbox exactly
with the same code, which runs just before this one.

I already don't know what to do, I've been looking for a solution the whole
Internet and I haven't found anything.

Can anybody help me?

Regards, David
 
C

Chris, Master of All Things Insignificant

Which variable is causing the exception? Sender? The code could be
happening in one of your click buttons. Rem out the exception to find the
exact line that is causing the problem and let us see that please.

Chris
 
C

Chris, Master of All Things Insignificant

Remove the try/catch and see where it crashes.

Chris
 
A

Alexandre Moura

Alternatively to removing the try catch, go to the debug menu, select exceptions, select the common language runtime exceptions, and select on the "when
the exception is thrown" break into the debugger

Hope that helps,
Alex MS VB QA

--------------------
From: "Chris, Master of All Things Insignificant" <chris@No_Spam_Please.com>
References: <[email protected]> <#[email protected]>
Subject: Re: NullReferenceException
Date: Fri, 21 Jan 2005 11:30:23 -0600
Lines: 16
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: atg-1750-1.chi.osi-usa.com 192.216.107.10
Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.languages.vb:255216
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Remove the try/catch and see where it crashes.

Chris

Sorry I don't take feature request for WinRes: it belongs to the .NET Framework SDK. I'm a consumer of WinRes, just like you...
--------------------
From: Thomas Adams <[email protected]>
Newsgroups: microsoft.public.dotnet.internationalization
Subject: RE: How to launch WinRes in full screen mode by another program?
Date: 29 Sep 2004 19:31:46 GMT
Organization: DFN.CIS Senior Customer
Lines: 17
Message-ID: <[email protected]>
References: <[email protected]> <[email protected]>
X-Trace: news.uni-berlin.de cGk7xWd2iWxkO9HVbF7isQODBzMeOPRUidb0ZHc/H3nGY=
User-Agent: Xnews/06.08.25
X-Converter: MorVer Version 1.0.305
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu- berlin.de!uni-berlin.de!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.internationalization:947
X-Tomcat-NG: microsoft.public.dotnet.internationalization

Hi

Your assumption is correct. I did not want to call out its long name
since I didn't know if that could be regarded as breach of NDA. :)

Thanks for the explanation. Do you take feature requests for WinRes?
I'd like to see a "remember last size and location" some day...

~T.

(e-mail address removed) (Xu Yang[MSFT]) wrote:

I'm afraid that LocStudio (when you say LS, I assume you are using LocStudio) does not have the option, and WinRes does not remember its size and
location when it was shut down.
If you are trying to call it in your own application, you can always use ProcessWindowStyle.Maximized when you start the process.

--------------------
From: Thomas Adams <[email protected]>
Newsgroups: microsoft.public.dotnet.internationalization
Subject: How to launch WinRes in full screen mode by another program?
Date: 11 Sep 2004 21:26:17 GMT
Organization: DFN.CIS Senior Customer
Lines: 9
Message-ID: <[email protected]>
X-Trace: news.uni-berlin.de 9sj2ViefNkwlw4tmA89WfA6mie8fmrCfbXqlIJqRehUb0=
User-Agent: Xnews/06.08.25
X-Face: #Rk@TOQ|^!ZG|&z6lA@-CY>/xB[Ei1mG*&S.+A5z;Ng?3OxX[#DVZw!"o!c`S|p:(zsX-EkdZZ(IVnFRTX%!:Sv^L&Gk~s]vJ@Z~%Rm@G]fr*r2P}u5 *&k/-_2+&Qowj6hiJ1b$^JQf:uy9456HIdKq*B`NC##kyO,>7"Ztnav+=71b*"E+DIme;{i&)ii{#6e?i8P,1Xpc[q0}i:Tm];B1
X-Converter: MorVer Version 1.0.305
Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu- berlin.de!uni-berlin.de!not-for-mail
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.internationalization:902
X-Tomcat-NG: microsoft.public.dotnet.internationalization

Hi

Let's imagine you're using a translation environment (LS) that's
launching WinRes every now and then. Is it possible to open WinRes in
full screen mode in this case? It's quite annoying that it doesn't
remember if I switch it to full screen mode the next time it is invoked.

thanks,
Thomas
 
E

elven byte

Hi.

Now, just on executing, it says FileNotFoundException with the file
mscorlib.dll

I assure to you the file exists and it is at the right place. What's
happening?
 
E

elven byte

Anyway, doing what you say just with the NullReferenceException I got the
same result. I can not even see the disassembler code.
 
A

Alexandre Moura

Mmm... I'm assuming you're executing the program under the debugger (starting with F5) - if not, try that - it'll be slow, but it should let you know where the
crash is occuring. If you're not executing under the debugger and can't do it for some reason, you could try removing the try catch and see what the call
stack for the exception looks like (I'm assuming that the exception has that information, but to be frank I'm not too familiar with the Pocket pc debugging
details) - Anyway, failing that, I'd check that the variable "e" is not nothing at the beginning, and then start tracing execution with msgboxes (might even be
faster than debugging :) )

Again, hope that helps,
Alex (MSFT VB QA)

--------------------
From: elven byte <[email protected]>
Newsgroups: microsoft.public.dotnet.languages.vb
Subject: Re: NullReferenceException
Date: Sat, 22 Jan 2005 16:32:59 +0000 (UTC)
Organization: elvenbyte
Lines: 7
Message-ID: <[email protected]>
References: <[email protected]> <#[email protected]>
NNTP-Posting-Host: 202.red-217-127-251.pooles.rima-tde.net
X-Trace: nsnmrro2-gest.nuria.telefonica-data.net 1106411579 8786 217.127.251.202 (22 Jan 2005 16:32:59 GMT)
X-Complaints-To: (e-mail address removed)-data.net
NNTP-Posting-Date: Sat, 22 Jan 2005 16:32:59 +0000 (UTC)
User-Agent: Xnews/5.04.25
Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fastwebnet.it!tiscali!newsfeed1.ip.tiscali.net!news.glorb.com! newscon02.news.prodigy.com!prodigy.net!newsfeed.cwix.com!nsnmpen1-lo.nuria.telefonica-data.net!nsnmrro2-lo.nuria.telefonica-data.net!not-for-mail
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.languages.vb:255388
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Anyway, doing what you say just with the NullReferenceException I got the
same result. I can not even see the disassembler code.

Sorry I don't take feature request for WinRes: it belongs to the .NET Framework SDK. I'm a consumer of WinRes, just like you...
--------------------
From: Thomas Adams <[email protected]>
Newsgroups: microsoft.public.dotnet.internationalization
Subject: RE: How to launch WinRes in full screen mode by another program?
Date: 29 Sep 2004 19:31:46 GMT
Organization: DFN.CIS Senior Customer
Lines: 17
Message-ID: <[email protected]>
References: <[email protected]> <[email protected]>
X-Trace: news.uni-berlin.de cGk7xWd2iWxkO9HVbF7isQODBzMeOPRUidb0ZHc/H3nGY=
User-Agent: Xnews/06.08.25
X-Converter: MorVer Version 1.0.305
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu- berlin.de!uni-berlin.de!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.internationalization:947
X-Tomcat-NG: microsoft.public.dotnet.internationalization

Hi

Your assumption is correct. I did not want to call out its long name
since I didn't know if that could be regarded as breach of NDA. :)

Thanks for the explanation. Do you take feature requests for WinRes?
I'd like to see a "remember last size and location" some day...

~T.

(e-mail address removed) (Xu Yang[MSFT]) wrote:

I'm afraid that LocStudio (when you say LS, I assume you are using LocStudio) does not have the option, and WinRes does not remember its size and
location when it was shut down.
If you are trying to call it in your own application, you can always use ProcessWindowStyle.Maximized when you start the process.

--------------------
From: Thomas Adams <[email protected]>
Newsgroups: microsoft.public.dotnet.internationalization
Subject: How to launch WinRes in full screen mode by another program?
Date: 11 Sep 2004 21:26:17 GMT
Organization: DFN.CIS Senior Customer
Lines: 9
Message-ID: <[email protected]>
X-Trace: news.uni-berlin.de 9sj2ViefNkwlw4tmA89WfA6mie8fmrCfbXqlIJqRehUb0=
User-Agent: Xnews/06.08.25
X-Face: #Rk@TOQ|^!ZG|&z6lA@-CY>/xB[Ei1mG*&S.+A5z;Ng?3OxX[#DVZw!"o!c`S|p:(zsX-EkdZZ(IVnFRTX%!:Sv^L&Gk~s]vJ@Z~%Rm@G]fr*r2P}u5 *&k/-_2+&Qowj6hiJ1b$^JQf:uy9456HIdKq*B`NC##kyO,>7"Ztnav+=71b*"E+DIme;{i&)ii{#6e?i8P,1Xpc[q0}i:Tm];B1
X-Converter: MorVer Version 1.0.305
Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu- berlin.de!uni-berlin.de!not-for-mail
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.internationalization:902
X-Tomcat-NG: microsoft.public.dotnet.internationalization

Hi

Let's imagine you're using a translation environment (LS) that's
launching WinRes every now and then. Is it possible to open WinRes in
full screen mode in this case? It's quite annoying that it doesn't
remember if I switch it to full screen mode the next time it is invoked.

thanks,
Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top