all groups > vj# > march 2004 >
You're in the

vj#

group:

Error


Error Reshma
3/16/2004 7:51:11 PM
vj#: 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


RE: Error Amit.vjc NO[at]SPAM online.microsoft.com
3/17/2004 9:03:06 AM
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]
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]
AddThis Social Bookmark Button