ETA: I use visual studio 2008 express edition.
If I override WndProc and mess up somehow, I’ll usually backtrack by commenting out code until it works again.
The strange thing with WndProc though is you can strip it down to:
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
MyBase.WndProc((m))
End Sub
and it still throws the error.
I have to remove the code and retype it in to reset the error.
Anyone else experienced this?
ETA:
Answered below by Chris Haas.
I hadn’t realised, but this problem must only have occurred when I’d used code from reflector. Reflector mis-translates to vb.net and inserts extra brackets into the calls to WndProc base.
When you wrap an argument in parenthesis you are overriding the
ByRefcall and instead calling itByVal. See Argument Not Being Modified by Procedure Call – Underlying VariableJust change the code to: