473,545 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

NullReferenceEx ception

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 BarcodeReaderDa ta As Symbol.Barcode. ReaderData
Public BarcodeEvents As System.EventHan dler

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 NullReferenceEx ception and the message tells me to use the "New"
keyword...

Details:
System.NullRefe renceException was unhandled
Message="NullRe ferenceExceptio n"
StackTrace:
at Symbol.Barcode. Reader..ctor()
at CocosOTR.TaskDr iver.DoInit()
at CocosOTR.TaskDr iver.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 4123
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 NullreferenceEx ception 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******** ******@TK2MSFTN GP02.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
9107
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 system.windows.forms.dll
5
2625
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 windows service wich sends emails to customers at a specific time. My app retrieves cities and the city's associated time from a database, waits...
1
536
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 system.windows.forms.dll. Additional information: Object reference not set to an instance of an object. Visual Studio's IDE is not allowing me to...
5
3056
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 code available (I am running in Debug mode of course). What could be the cause of this? Can someone shed some light on this matter? Kind...
2
3183
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 C# version. The C++ version works while the C# version returns the NullReferenceException on a call to Connect(). The Open() and Close()...
2
7789
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 in treeview i display the content item in axWebBrowser, i close the sub form normally when i close the main the following error is generated An...
1
4083
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. ---------------------------------------------------------------------------- ------------------------------------------- Public Class TestClass Public NextSubIndex As Integer = 1 Public arrTestSubClass() As TestSubClass
6
22203
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 Public Structure Attend Dim DaysTardy As Double
9
351
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. System.NullReferenceException: Object reference not set to an instance of an object. -- Xero
3
2460
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. Inside this function iam getting a runtime error when the command object calls the prepare method.
0
7805
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7752
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5969
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5325
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4944
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3449
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1878
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
701
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.