[fpc-pascal]parameter is 0x0 on callback

Marc Santhoff M.Santhoff at t-online.de
Fri Jun 4 05:00:51 CEST 2004


Hello,

I've used the stuff following with fpc 1.0.10 and it worked fine, now
with 1.9.2 the argument is set to zero:

- a GTK+ 1.2 program)
- a dialog has a pointer to a 'cdecl'ed callback procedure:

<code>
...
src := TCustomer(datasrc.Items[selCursor]);
{$ifdef debug} writeln(src.asCSV); {$endif}

{ propagate selected entry }
cbPropagate(src);
...
</code>

the debug output is okay, public string fields are filled. There the
field 'Name' is accessed.

This is where 'cbPropagate' goes to:

<code>
procedure setCustDataCallback(data: TCustomer); cdecl;
begin
	writeln('Name is '+_data.Name);
...
</code>

when trying to write out the TCustomer field 'Name' declared as an
AnsiString, the debugger tells me 'data' points to zero (0x0).

Can someone please explain to me what's happening here?
And why it worked fine on the 1.0.10 version of fpc?

TIA,
Marc






More information about the fpc-pascal mailing list