Does the callback not need a parameter or 3? The stack will be all over
the place
if it does...
99% of windows callbacks atleast take a hWND and return an integer.
Nic.
Alistair George wrote:
A while ago, Nic kindly came up with an answer to my query about a callback
proceedure. Well today I implimented the procs as below.
The callback works, but it causes an access violation error, and that is
with NOTHING being done in the callback proc at all - it should just go
there and return. But in going to the call (and it does reach it) and
returning, there is some violation.
Could it be that stdcall is expecting something to be returned??
the docs say that Stdcall is a function, but recommend using it.
Any suggestions appreciated.
Tks,
Al+
Type TMyClass = class
procedure mycallback;
end;
var
myclass : TMyClass;
implementation
procedure TMyClass.myCallBack;
begin
//do whatever - you need to add params no doubt.
end;
procedure CallBack;stdcall;
begin
myClass.myCallBack; //just throw it into the object for more
processing
//you could do it all here, tho
end;
initilization
myClass := TMyClass.Create;
end.
---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
--
Nic Wise - Inprise New Zealand Ltd. [EMAIL PROTECTED]
09-360-0231 (wk), 021-676-418 (mob), [EMAIL PROTECTED] (hm)
My opinions do not reflect the opinions of my employer,
or myself at times.
---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz