#1 2014-02-20 11:13:58

Registered: 2014-02-10
Posts: 17

dsp TMessage errors.

I am using Delphi XE5 and FireMonkey, this error had always occured but it never stopped me from debugging, until now.
In the SynCommons.pas:

function WndProcMethod(Hwnd: HWND; Msg,wParam,lParam: integer): integer; stdcall;
var obj: TObject;
    dsp: TMessage;
  {$ifdef CPU64}
  obj := pointer(GetWindowLongPtr(HWnd,GWLP_USERDATA));
  obj := pointer(GetWindowLong(HWnd,GWL_USERDATA)); // faster than GetProp()
  if not Assigned(obj) then
    result := DefWindowProc(HWnd,Msg,wParam,lParam) else begin

    dsp.msg := Msg;
    dsp.wParam := WParam;
    dsp.lParam := lParam;
    dsp.result := 0;
    result := dsp.result;

I get the errors:
[dcc32 Error] SynCommons.pas(21453): E2003 Undeclared identifier: 'msg'
[dcc32 Error] SynCommons.pas(21454): E2003 Undeclared identifier: 'wParam'
[dcc32 Error] SynCommons.pas(21455): E2003 Undeclared identifier: 'lParam'
[dcc32 Error] SynCommons.pas(21456): E2003 Undeclared identifier: 'result'
[dcc32 Error] SynCommons.pas(21458): E2003 Undeclared identifier: 'result'
[dcc32 Error] SynCommons.pas(21617): E2003 Undeclared identifier: 'WM_QUIT'

When I go to the definition of dsp : TMessage , the TMessage comes from FMX.Messages.pas.
Is this supposed to happen?

Please help, I cannot debug anymore.


#2 2014-02-20 13:43:00

From: France
Registered: 2010-06-21
Posts: 13,763

Re: dsp TMessage errors.

Our units expects the Windows Messages.pas unit, and won't work with FireMonkey.

It is not planned for the moment at all.
Perhaps when it may be stabilized, but we won't need it internally - we rather focus on HTML5 apps for cross-platform clients (via SmartMobileStudio).

If you want to contribute, you are welcome!


#3 2014-02-24 09:28:26

From: Nijmegen, Netherlands
Registered: 2012-08-01
Posts: 173

Re: dsp TMessage errors.

Ha Ab, X

Combining FMX with mormot is no problem. (Out app LCS runs server and client currently with FMX and Mormot), but you do lose the multiplatform functionality.
FTM I would be helpful to split Mormot into parts (packages,units) that are platform dependent and independent(Like the parts contaning windows messaging). (Currently there is no big need for this from our side).

The compiler error here is probably caused by fmx being in the "unit scope names" list of the delphi compiler settings. Just kick "fmx" out of there, and add "Winapi" amnd "System.Win" si the correct "messages.pas" is linked instead of the fmx.messages unit. Otherwise replace the "messages" in the units list with "winapi.messages", that may help too.

Regards - Hans

Last edited by h.hasenack (2014-02-24 09:35:57)


#4 2014-02-24 11:05:11

From: France
Registered: 2010-06-21
Posts: 13,763

Re: dsp TMessage errors.

I've added http://synopse.info/fossil/info/b07ceddab6

That is, rewrite code to avoid platform-specific issues.

Any input is welcome!


#5 2014-02-24 22:26:13

From: London
Registered: 2010-07-20
Posts: 297

Re: dsp TMessage errors.

As a first step would it make sense to extract the string and JSON handling routines out of SynCommons to a separate unit? I've found this set of routines seem to compile fine under Lazarus on OSX and I guess are fairly platform agnostic. It then shouldn't be too much work to get a basic OSX client up and running.

This may be a half-baked idea but could these string and JSON routines be put in a .inc file. This could then be included in SynCommons.pas but also in a new unit called, eg, SynSrings.pas so it wouldn't be a breaking change and people could migrate gradually to new unit names.


Board footer

Powered by FluxBB