M
Martin
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
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