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

to herfried

P: n/a
in class1 : i used public event
Public Event onSeverMessage(ByVal szText As String)

then in class 2 i called from class1
Private WithEvents _Connection As New Class1
then i did withevents
Private Sub _Connection_onSeverMessage(ByVal szText As String) Handles
_Connection.onSeverMessage
DisplayMessage(nStatus.rtbStatus, szText) <=== this wIll
cause error problem because of szText needed to instantiate object but
i'm not sure
End Sub
now if i replaced szText to " " then i can see all data comming in debug
window this will gave no error problem

then back in class1 then i did raisevents
Select Case C(1).Trim
Case "001" To "014", "251" To "272", "372" To "377",
"401", "422", "462", "468", "503"
Dim intA As Integer = CLi.IndexOf(Nick, 0)
RaiseEvent onSeverMessage(CLi.Substring(intA +
Nick.Length))
\\\
end select

the error is '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.
regards,

Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
http://www.vbdotnetheaven.com/

"Supra" <su*****@rogers.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
in class1 : i used public event
Public Event onSeverMessage(ByVal szText As String)

then in class 2 i called from class1
Private WithEvents _Connection As New Class1
then i did withevents
Private Sub _Connection_onSeverMessage(ByVal szText As String) Handles
_Connection.onSeverMessage
DisplayMessage(nStatus.rtbStatus, szText) <=== this wIll cause
error problem because of szText needed to instantiate object but i'm not
sure
End Sub
now if i replaced szText to " " then i can see all data comming in debug
window this will gave no error problem

then back in class1 then i did raisevents
Select Case C(1).Trim
Case "001" To "014", "251" To "272", "372" To "377",
"401", "422", "462", "468", "503"
Dim intA As Integer = CLi.IndexOf(Nick, 0)
RaiseEvent onSeverMessage(CLi.Substring(intA +
Nick.Length))
\\\
end select

the error is '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.
regards,

Nov 21 '05 #2

P: n/a
"Chris, Master of All Things Insignificant" <chris@No_Spam_Please.com>
schrieb:
http://www.vbdotnetheaven.com/


LOL!!!

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3

P: n/a
"Supra" <su*****@rogers.com> schrieb:

Please don't mention my name in a post's subject. Newsgroup posts are
directed to everybody reading the group.
Public Event onSeverMessage(ByVal szText As String)

then in class 2 i called from class1
Private WithEvents _Connection As New Class1
then i did withevents
Private Sub _Connection_onSeverMessage(ByVal szText As String) Handles
_Connection.onSeverMessage
DisplayMessage(nStatus.rtbStatus, szText) <=== this wIll cause
error problem because of szText needed to instantiate object but i'm not
sure
End Sub
now if i replaced szText to " " then i can see all data comming in debug
window this will gave no error problem


Post the implementation of 'DisplayMessage' and the /complete/ error
message.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #4

P: n/a

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
"Supra" <su*****@rogers.com> schrieb:

Please don't mention my name in a post's subject. Newsgroup posts are
directed to everybody reading the group.


Oh, you know you like it! :P

Mythran
Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.