InertiaM
Well-known member
Stripped down code :-
When it tries to process Convert.ToInt32(m.WParam), I get :-
but if I use m.WParam.ToInt32, it works.
1. Why?
2. Are there any other occasions like this, when I shouldnt be using a Convert. method?
VB.NET:
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Select Case m.Msg
Case WM_SYSCOMMAND
Select Case Convert.ToInt32(m.WParam)
Case Else
MyBase.WndProc(m)
End Select
Case Else
MyBase.WndProc(m)
End Select
End Sub
When it tries to process Convert.ToInt32(m.WParam), I get :-
VB.NET:
Unable to cast object of type 'System.IntPtr' to type 'System.IConvertible'.
but if I use m.WParam.ToInt32, it works.
1. Why?
2. Are there any other occasions like this, when I shouldnt be using a Convert. method?