D
David
Hi,
I am having trouble with a form that I have loaded trying to access a
procedure on the main form.
The trouble seems to be that a Global Array that is declare in a Module is
producing a Nullreference error when I try to call the procedure on the main
form.
ie.
Module 1 contains
Public TXBuff(100) As Byte
Public mainform As Form1
The second form contains code
TXBuff(0) = 2
TXBuff(1) = 13
TXBuff(2) = 6
mainform.Send(3)
And the main form contains code
Public Sub Send(ByVal nbytes As Integer)
RXBytes = 0
DisplayTXBytes(nbytes)
SerialConnection.Write(TXBuff, 0, nbytes)
ReplyTimer.Enabled = True
End Sub
The exact error is ...
An unhandled exception of type 'System.NullReferenceException' occurred in
Config Utility Source.exe
Additional information: Object reference not set to an instance of an
object.
Thanks in advance for any help
I am having trouble with a form that I have loaded trying to access a
procedure on the main form.
The trouble seems to be that a Global Array that is declare in a Module is
producing a Nullreference error when I try to call the procedure on the main
form.
ie.
Module 1 contains
Public TXBuff(100) As Byte
Public mainform As Form1
The second form contains code
TXBuff(0) = 2
TXBuff(1) = 13
TXBuff(2) = 6
mainform.Send(3)
And the main form contains code
Public Sub Send(ByVal nbytes As Integer)
RXBytes = 0
DisplayTXBytes(nbytes)
SerialConnection.Write(TXBuff, 0, nbytes)
ReplyTimer.Enabled = True
End Sub
The exact error is ...
An unhandled exception of type 'System.NullReferenceException' occurred in
Config Utility Source.exe
Additional information: Object reference not set to an instance of an
object.
Thanks in advance for any help