By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,989 Members | 2,392 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,989 IT Pros & Developers. It's quick & easy.

NullReferenceException

P: n/a
Hi All!

I'm developing an app in VB2005 for Windows Mobile 5.0 (compact framework).

I'm a beginner in VB.Net after years of programming in VB6 and its
predecessors.

Now I ran into a problem, which I can't solve.

In a module I made the following declarations:
Public BarcodeReader As Symbol.Barcode.Reader
Public BarcodeReaderData As Symbol.Barcode.ReaderData
Public BarcodeEvents As System.EventHandler

Then in the actual program (also a module) I do this:

Sub DoInit()

'Create new reader, first available reader will be used.
BarcodeReader = New Symbol.Barcode.Reader()

End Sub

Now I get a NullReferenceException and the message tells me to use the "New"
keyword...

Details:
System.NullReferenceException was unhandled
Message="NullReferenceException"
StackTrace:
at Symbol.Barcode.Reader..ctor()
at CocosOTR.TaskDriver.DoInit()
at CocosOTR.TaskDriver.Main()

But I did use the New keyword to create the instance. What am I doing wrong?

Hope someone can help...
Tia,
Martin
May 11 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
cod
Martin wrote:
Hi All!
But I did use the New keyword to create the instance. What am I doing wrong?
Hi,
now I have no symbol sdk on my pc, but I think that you must create an
instance of Symbol.Barcode.Reader from another object .. see the example
on symbol sdk ..

bye
cod
May 11 '07 #2

P: n/a
Hi Cod,

Thanks for your reply. I originally thought there was something wrong with
my statement, but it turns out that the NullreferenceException take place in
the Symbol classes. This happens when the system runs on a Non-Symbol
machine (thus without the barcode scanner present).

Thanks again for taking the time to respond,
Martin
"cod" <wo*****@gmail.comwrote in message
news:ux**************@TK2MSFTNGP02.phx.gbl...
Martin wrote:
>Hi All!
>But I did use the New keyword to create the instance. What am I doing
wrong?

Hi,
now I have no symbol sdk on my pc, but I think that you must create an
instance of Symbol.Barcode.Reader from another object .. see the example
on symbol sdk ..

bye
cod

May 13 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.