[fpc-pascal] problem with interface (OOP not widget)
JoshyFun
joshyfun at gmail.com
Tue Jan 29 16:13:06 CET 2008
Hello Bee,
Tuesday, January 29, 2008, 7:44:14 AM, you wrote:
>> So, may I made a conclusion that this is a bug?
B> http://bugs.freepascal.org/view.php?id=10684
B> Is there any feasible workaround for this before the bug is fixed? TIA.
I wrote some small changes to your code and the bug only raises when
calling convention is cdecl and optional parameter default value is
set, but mostly related to "cdecl" and interfaces because as I remove
the "cdecl" everything seens to compile fine in all situations,
meanwhile removing optional parameter can also rise the "bug" if I
perform some type conversions "brute forced".
To workaround I wrote it in this way, adding a new wrapper function:
----------------
function QuerySimple2(const OnChange: TNotifyEvent): ISimple; cdecl;
begin
Result :=TSimple.Create;
end;
function QuerySimple(const OnChange: TNotifyEvent =nil): ISimple;
begin
Result :=QuerySimple2(OnChange);
end;
----------------
It is not very elegant, I know :)
--
Best regards,
JoshyFun mailto:joshyfun at gmail.com
More information about the fpc-pascal
mailing list