Recent

Author Topic: TMemo issue on Windows Mobile 6.1  (Read 5244 times)

iMan Biglari

  • New member
  • *
  • Posts: 5
TMemo issue on Windows Mobile 6.1
« on: May 06, 2013, 02:05:19 pm »
I'm writing a very simple terminal application for Windows Mobile. It opens a serial port, and dumps whatever data is coming into a TMemo. The application works just fine on Windows Mobile 5, but on Windows Mobile 6.1, the memo acts strangely. After about 100 characters, no more text is added to the memo and it does not paint itself (e.g. if I open the start menu and close it, the text is not shown anymore). I used this code in a simple application and it reproduced the issue. Any thoughts?

procedure TForm1.Button1Cick(Sender: TObject);
begin
  while not Application.Terminated do
  begin
    mmPort.Text := mmPort.Text + Chr(Random(90) + 32);
    if Random > 0.9 then
      Application.ProcessMessages;
  end;
end;
There is no worse death than that of hope

bambamns

  • Full Member
  • ***
  • Posts: 223
Re: TMemo issue on Windows Mobile 6.1
« Reply #1 on: May 18, 2013, 05:40:43 am »
Hi,

Did you tried with TStringGrid ?
Lazarus 1.8.4 + FPC 2.6.4 x86 (rebuild) and Lazarus 2.0, Windows 7 x64, unless otherwise specified

iMan Biglari

  • New member
  • *
  • Posts: 5
Re: TMemo issue on Windows Mobile 6.1
« Reply #2 on: May 18, 2013, 02:47:58 pm »
Hi,

Did you tried with TStringGrid ?
Hi
No, because String Grid can not show raw text. I'm currently using a paint box  :( (I know; that's the worst way to deal with text).
There is no worse death than that of hope

Cyrax

  • Hero Member
  • *****
  • Posts: 758
Re: TMemo issue on Windows Mobile 6.1
« Reply #3 on: May 18, 2013, 04:38:52 pm »
I'm writing a very simple terminal application for Windows Mobile. It opens a serial port, and dumps whatever data is coming into a TMemo. The application works just fine on Windows Mobile 5, but on Windows Mobile 6.1, the memo acts strangely. After about 100 characters, no more text is added to the memo and it does not paint itself (e.g. if I open the start menu and close it, the text is not shown anymore). I used this code in a simple application and it reproduced the issue. Any thoughts?

procedure TForm1.Button1Cick(Sender: TObject);
begin
  while not Application.Terminated do
  begin
    mmPort.Text := mmPort.Text + Chr(Random(90) + 32);
    if Random > 0.9 then
      Application.ProcessMessages;
  end;
end;


You should either use thread or Application.OnIdle (or similar). IMHO using that kind of loop is wrong if you want output something in real time.

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: TMemo issue on Windows Mobile 6.1
« Reply #4 on: May 20, 2013, 04:11:35 am »
I'd like to get this program working in WinCE:
  http://www.ctrlterm.com/

Please contact me and maybe we could work together?
Regards,
Paul Breneman
www.ControlPascal.com

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: TMemo issue on Windows Mobile 6.1
« Reply #5 on: May 20, 2013, 01:53:49 pm »
About the original problem: TMemo is a native component, so it might be some kind of issue or limitation on the native control.

Try using TCDMemo from the package CustomDrawn. It might work.

iMan Biglari

  • New member
  • *
  • Posts: 5
Re: TMemo issue on Windows Mobile 6.1
« Reply #6 on: May 20, 2013, 09:31:45 pm »
About the original problem: TMemo is a native component, so it might be some kind of issue or limitation on the native control.

Try using TCDMemo from the package CustomDrawn. It might work.
I believe by native component, you mean a standard Windows control. I'm having this problem only when running my application on my phone. Everything seems perfectly normal in the simulator.
I'll try TCDMemo in a few days and report the results here. Thanks for the suggestion.
There is no worse death than that of hope

iMan Biglari

  • New member
  • *
  • Posts: 5
Re: TMemo issue on Windows Mobile 6.1
« Reply #7 on: May 20, 2013, 09:32:42 pm »
I'd like to get this program working in WinCE:
  http://www.ctrlterm.com/

Please contact me and maybe we could work together?

I'll get back to you in a week or so. I'm currently busy with a major customer.  :)
There is no worse death than that of hope