Containing type does not implement interface IMessageFilter
<p>I'm still trying to find out what is happening with this error:</p>

<blockquote>
  <p><em>OCR.test.IMessageFilter.PreFilterMessage(ref System.Windows.Forms.Message): containing type does not implement interface System.Windows.Forms.IMessageFilter</em></p>
</blockquote>

<p>Here are my codes:</p>

<pre><code>bool IMessageFilter.PreFilterMessage(ref Message m) // Error with this line
{
    TwainCommand cmd = tw.PassMessage(ref m);
    if (cmd == TwainCommand.Not)
        return false;

    switch (cmd)
    {
        case TwainCommand.CloseRequest:
        {
            EndingScan();
            tw.CloseSrc();
            break;
        }
        case TwainCommand.CloseOk:
        {
            EndingScan();
            tw.CloseSrc();
            break;
        }
        case TwainCommand.DeviceEvent:
        {
           break;
        }
        case TwainCommand.TransferReady:
        {
            ArrayList pics = tw.TransferPictures();
            EndingScan();
            tw.CloseSrc();
            picnumber++;
            for (int i = 0; i &lt; pics.Count; i++)
            {
                IntPtr img = (IntPtr)pics[i];
                PicForm newpic = new PicForm(img);
                newpic.MdiParent = this;
                int picnum = i + 1;
                //newpic.Text = "ScanPass " + picnumber.ToString() + "_Pic " + picnum.ToString();
                newpic.Show();
            }
            break;
        }
    }

    return true;
}
</code></pre>
