473,385 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

NullReferenceException

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
2 4102
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Terrence | last post by:
I am doing some of the C# walkthroughs to transition from VB to C#. When I try to execute static void Main() { Aplication.Run(new Form1()) } I raise a 'System.NullReferenceException" in...
5
by: Fabio Papa | last post by:
Hi, I am fairly new to programming and and even newer to dotnet. I appoligise in advance if this is a dumb questions, and I would appreciate if you could answer it anyways. :) I am writing a...
1
by: Rafael | last post by:
Hi, I hope I can find some help for this problem IDE: Visual Studio.NET 2003 Developer Editio Language: C# Problem: "An unhandled exception of type 'System.NullReferenceException' occurred in...
5
by: TT (Tom Tempelaere) | last post by:
Hi, Once in a while my application throws an NullReferenceException at startup, however it appears to be occurring in an unknown module. If I debug it and ask to 'break', then there is no source...
2
by: Enrico Pangan | last post by:
I'm trying to call some functions in a C++ Dll, "Library.dll" from C#. Some functions work but some return the NullReferenceException. I have here the source code for the C++ version and for the...
2
by: Raed Sawalha | last post by:
i have a windows form(Main) with listview, when click an item in listview i open other window form (Sub) which generate the selected item from parent window in as treeview items when click any item...
1
by: msnews.microsoft.com | last post by:
I'm trying to fill an array of objects but when I add the first object I get a NullReferenceException. ----------------------------------------------------------------------------...
6
by: William Mild | last post by:
I must be getting brain fried. I can't see the error. Create a new web form with the following code begind: Public Class test Inherits System.Web.UI.Page Public Class ReportCardData ...
9
by: Xero | last post by:
could anybody describes a scenario where this error will occur? i have visited the page about the NullReferenceException in msdn library but i still have no idea what it is about. thanks. ...
3
by: Sagar | last post by:
Hi. I am working on a project to migrate a web application from 1.1 to 2.0 Within in the DAL of the application, there is a call to below function that builds a command object for later use. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.