c# - Containing type does not implement interface IMessageFilter -
i'm still trying find out happening error:
ocr.test.imessagefilter.prefiltermessage(ref system.windows.forms.message): containing type not implement interface system.windows.forms.imessagefilter
here codes:
bool imessagefilter.prefiltermessage(ref message m) // error 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++; (int = 0; < pics.count; i++) { intptr img = (intptr)pics[i]; picform newpic = new picform(img); newpic.mdiparent = this; int picnum = + 1; //newpic.text = "scanpass " + picnumber.tostring() + "_pic " + picnum.tostring(); newpic.show(); } break; } } return true; }
the class implement prefiltermessage method needs derive imessagefilter interface. missed it
public class foo: imessagefilter { bool imessagefilter.prefiltermessage(ref message m) { // code } }
Comments
Post a Comment