Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-10

error in win32callback.inc

5 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Micha Nelissen

Hi,

Problem: unit messages is both present in the lcl and in the fpc rtl for the win32 port. So, the messages unit does not exist in the non-win32 rtl.

Therefore the suggestion is to move all 'emulation units', like the messages unit, to a non-win32 directory and compile it only when the target is not win32. Then let the win32 lcl use the fpc win32-rtl one and other platforms the 'emulated' one from non-win32 directory.

In the future, Com, Ole, ActiveX can be moved into this non-win32 directory as well, as the rtl doesn't provide emulation for that.

Regards,

Micha.

Reply by email

Mattias Gaertner
to Micha Nelissen
Show quoted text 15 lines
in module win32callback.inc in procedure MAINWIN for code: forgot declarations of LIST and C {$IFDEF VER1_1} List := TMsgArray(GetProp(Window, 'MsgList')); If Pointer(List) Nil Then For C := 0 To Length(List) Do If List[C] = PLMsg^.Msg Then Begin DeliverMessage(OwnerObject, PLMsg^); Exit; End; {$ELSE VER1_1}

Added. Untested. I have no 1.1.

Mattias

Reply by email

Florian Klaempfl
to Micha Nelissen: Problem: unit messages is both present in the lcl and in the fpc rtl for the win32 port.…
Mattias Gaertner wrote 17 lines
On Mon, 06 Oct 2003 14:55:18 +0200 Micha Nelissen wrote: >Hi, > >Problem: unit messages is both present in the lcl and in the fpc rtl for > the win32 port. So, the messages unit does not exist in the non-win32 >rtl. > >Therefore the suggestion is to move all 'emulation units', like the >messages unit, to a non-win32 directory and compile it only when the >target is not win32. The target is not given to the LCL (the lcl without interfaces). It is given to the LCL interfaces. The LCL is platform independent.

But the makefile knows about the target I guess :) So simply add lazarus/nonwin32 to the unit search path if the target isn't win32. The messages.pp is moved to this directory and the compiler finds it only for non-win32 (gtk/native whatever doesn't matter in this case) targets.

I sent Micha a patch which solves all these issues for 1.1 with type aliases. lmessages.pp uses the types from messages.pp of the rtl when compiled with 1.1 and on win32. Else it defines them and lazarus/nonwin32/messages.pp uses them :)

Show quoted text 13 lines
The messages.pp exists only for Delphi compatibility and *not* for win32 compatibility. Therefore messages.pp only uses messages from the lmessages.pp. Normally no LCL application should use the win32 messages. Of course the win32 intf and win32 specific components will need the win32 messages.pp from the RTL. Hmm. Tricky. Either we copy the messages.pp from rtl to a new unit win32messages.pp in the lcl/interfaces/win32 dir. (My favourite). Or we remove messages.pp from the LCL and porting Delphi units will become more difficult. Think about someone working under win32, porting a unit to Lazarus. He will have the messages unit in the rtl and the program will compile, maybe even work. But the program will fail on all other platforms.

Reply by email

Mattias Gaertner
to Micha Nelissen: Problem: unit messages is both present in the lcl and in the fpc rtl for the win32 port.…
Show quoted text 9 lines
Hi, Problem: unit messages is both present in the lcl and in the fpc rtl for the win32 port. So, the messages unit does not exist in the non-win32 rtl. Therefore the suggestion is to move all 'emulation units', like the messages unit, to a non-win32 directory and compile it only when the target is not win32.

The target is not given to the LCL (the lcl without interfaces). It is given to the LCL interfaces. The LCL is platform independent. The messages.pp exists only for Delphi compatibility and *not* for win32 compatibility. Therefore messages.pp only uses messages from the lmessages.pp.
Normally no LCL application should use the win32 messages. Of course the win32 intf and win32 specific components will need the win32 messages.pp from the RTL. Hmm. Tricky.

Either we copy the messages.pp from rtl to a new unit win32messages.pp in the lcl/interfaces/win32 dir. (My favourite). Or we remove messages.pp from the LCL and porting Delphi units will become more difficult. Think about someone working under win32, porting a unit to Lazarus. He will have the messages unit in the rtl and the program will compile, maybe even work. But the program will fail on all other platforms.

Mattias

Show quoted text 15 lines
Then let the win32 lcl use the fpc win32-rtl one and other platforms the 'emulated' one from non-win32 directory. In the future, Com, Ole, ActiveX can be moved into this non-win32 directory as well, as the rtl doesn't provide emulation for that. Regards, Micha. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email