Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Delphi > Setting Up Call...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 1071 of 1132
Post > Topic >>

Setting Up Callback

by Phil Grace <phil@[EMAIL PROTECTED] > Jul 10, 2006 at 03:30 AM

Hi,

I'm trying to set up a callback from a function in a .dll and can't
seem to land on the right syntax....

The function itself is defined like this :

{ typedefs with special meaning }
aDHandle = integer;	{ database file handle }
aLong = Longint;	{ 32-bit signed integer }
aResult = integer;	{ returned result code }

function  PclReindex (fdh:aDHandle; kmask:aLong;
callback:integer):aResult; stdcall;

.... and then I need to define a function like this :

   aReindexCallback = function (funcno:anInt; par1:aLong;
par2:aLong):aResult;

.... what I have ben playing around with is the following, the compiler
complains with "Not enough actual parameters".

function ReindexCallback (funcno:anInt; par1:aLong;
par2:aLong):aResult; 
begin
  result := 0;
end;

procedure TMainForm.Reindex (sPath, sFile : string ); var
  sFilename : string;
  fh : integer;
  cb : aReindexCallback;
begin
  sFilename := (sPath + '\' + sFile);
  fh := OpenAFile ( sFilename );
  Progress ( format('Reindexing %s ...',[sFilename]) );

  cb := ReindexCallback;
  PclReindex( fh, 0, cb);
  PclClose(fh);
end;



any help would be much appreciated.

Regards,
Phil.
 




 2 Posts in Topic:
Setting Up Callback
Phil Grace <phil@[EMAI  2006-07-10 03:30:01 
Re: Setting Up Callback
Jamie <jamie_ka1lpa_no  2006-07-15 21:32:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 6 15:55:59 CDT 2008.