[fpc-pascal]parameter is 0x0 on callback

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


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:

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

{ propagate selected entry }

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

This is where 'cbPropagate' goes to:

procedure setCustDataCallback(data: TCustomer); cdecl;
	writeln('Name is '+_data.Name);

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?


More information about the fpc-pascal mailing list