PreFilterMessage method takes parameter by reference.
Declare this method in the following way.
public boolean PreFilterMessage(/**@ref*/ Message m)
This will solve your problem.
--------------------
[quoted text, click to view] >Thread-Topic: Error
>thread-index: AcQL0xZQjMsrAHzlSNiWsxYMAW0+yw==
>X-Tomcat-NG: microsoft.public.dotnet.vjsharp
>From: =?Utf-8?B?UmVzaG1h?= <anonymous@discussions.microsoft.com>
>Subject: Error
>Date: Tue, 16 Mar 2004 19:51:11 -0800
>Lines: 32
>Message-ID: <2D1021F6-D3E4-47F4-A441-F14E2A845B06@microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>Newsgroups: microsoft.public.dotnet.vjsharp
>Path: cpmsftngxa06.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.vjsharp:5685
>NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
>X-Tomcat-NG: microsoft.public.dotnet.vjsharp
>
>hello,
I have implemented IMessageFilter interface in a class TestMessageFilter.
In it I have defined
public boolean PreFilterMessage(Message m)
function.
But while compiling, I am getting following error.
'TestMessageFilter' must be declared 'abstract' or
'System.Windows.Forms.IMessageFilter.PreFilterMessage(byref
System.Windows.Forms.Message)' must be implemented
The actual code is
import System .* ;
import System.Windows.Forms .* ;
public class Form1 extends Form
{
protected ListBox textBox1;
public class TestMessageFilter implements IMessageFilter
{
public boolean PreFilterMessage(Message m)
{
// Blocks all the messages relating to the left mouse button.
if (m.get_Msg() >= 513 && m.get_Msg() <= 515)
{
Console.WriteLine(("Processing the messages : " + m.get_Msg()));
return true;
}
return false;
} //PreFilterMessage
} //TestMessageFilter
} //Form1
Can any one help me ?
[quoted text, click to view] >