Event handlers...



OK. I just know I'm doing something wrong, because assigning an event
handler is easy...

There's no classes involved, except for prn (the object generating
events)

Here's the procedure for handling the event:
cancelQry is a TDataset which is being acted upon elsewhere. It is a
global. (Since I can't pass in parameters, and I want this handler to
be used wherever I have a printing progress indicator. I know, it's a
hack :) )

procedure PrnCancel(Sender: TObject);
begin
if assigned(cancelQry) then
cancelQry.last;
end;

Here's how I'm assigning the event handler:

cancelQry := myQry;
prn.OnCancel := prnCancel;

Here's the error message I'm getting from the compiler:
incompatible types: 'method pointer and regular procedure'

Initially, I had the handler in a different unit, and then I tried
putting it in the same unit, but still got the error message.

What am I doing wrong??

-Corinna

.



Relevant Pages

  • Closure code to assign image index to onload handler
    ... I'm writing some code that loads a number of images, ... standard mechanism of assigning a src url to a newly constructed Image ... thus invoking the image-load operation. ... an image.onload handler I've previously assigned will be called. ...
    (comp.lang.javascript)
  • Re: Closure code to assign image index to onload handler
    ... standard mechanism of assigning a src url to a newly constructed Image ... On a successful load, ... an image.onload handler I've previously assigned will be called. ...   but remember, you're not passing the value of the variable here, ...
    (comp.lang.javascript)
  • Re: Closure code to assign image index to onload handler
    ... standard mechanism of assigning a src url to a newly constructed Image ... On a successful load, ... an image.onload handler I've previously assigned will be called. ...   but remember, you're not passing the value of the variable here, ...
    (comp.lang.javascript)
  • Re: Closure code to assign image index to onload handler
    ... standard mechanism of assigning a src url to a newly constructed Image ... On a successful load, ... an image.onload handler I've previously assigned will be called. ...   but remember, you're not passing the value of the variable here, ...
    (comp.lang.javascript)
  • Re: Closure code to assign image index to onload handler
    ... standard mechanism of assigning a src url to a newly constructed Image ... thus invoking the image-load operation. ... On a successful load, ... an image.onload handler I've previously assigned will be called. ...
    (comp.lang.javascript)