Sign in Join

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

Mailing lists / lazarus / 2013-03

One last ask for help

17 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

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

Arí Ricardo Ody

I wrote an application for WinCE in Lazarus 0.9.30/FPC 2.4.2 some time ago. Finally appear a customer interested in the system. It was tested in an iPaq equipment during the development stage. Late I tested it with a Motorola ES400 handheld when I can test the functions using a barcode scanner. Everything were alright. I have the idea that my software were ready to sale even if the customer wants to use barcode scanner as data entry for some fields in my forms.

Based on this I offer the software for the mentioned customer and tell him that it always have to rent(or buy) a handheld with windows mobile 6 or greater.

He gave me, last friday, an handhelp Intermec with windows mobile 6.1. The model was Intermec CK3a1. I installed my software in the equipment and it ran ok as expected, since it have a arm processor and windows mobile 6 or later. Next step was test the program reading barcodes via CK3a1 barcode reader. Then I go to hell. The CK3a1 read the barcode as indicated by the sound an the pilot light but nothing appears in the correspondent Lazarus edit box. I spent all weekend trying to learn what was wrong. Monday, very ashamed I told to the customer that the program was not running Ok with Intermec CK3a1. In the monday I tested with another Intermec, the CN50 model and the same error occurred. I tried with an old HP handheld and an external barcode reader attached in the slot of the HP and everything was right. The barcode read was successful.

The customer call the firm that rented the equipment and it offers to substitute by a Cipher CP30. After a long time of tests I discover that if I open the "barcode" software(it comes with CP30) and use the barcode reader with my program, the barcode was read, but the first character of the barcode is left. The rental firm people try lots of combinations of configurations in the Cipher CP30. And the problem persists.

This afternoon the customer give me an ultimatum. If the software doesn't run with a correct codebar reading they will change to another program.

In all cases, if I install a .net(wrote in C#) in the handhelp, the barcode is readed and is readed correct.

Well people. I know that you have no duty to help me. But once more I ask for help with this problem. I believe in the same dream you believe: Write once, compile everywhere. But I still believe that the code generated will run as expected.

No one in the Lazarus community can help me? Why I wrote in the mailing list, english forum and portuguese forum and nobody answer?

If the ,net application and even the windows mobile application "note" read the barcode correct, is them wrong or is there something wrong with the way Lazarus and FPC talk with the WinCE(windows mobile 6 or later) I/O routines? Will WinCe change?

Here are now 11:33 PM. I have 'till 12 AM tomorrow to tell something to the customer.

Look here the potential customer I'll lost: http://www.votorantim.com.br/en-US/Pages/home.aspx

Think about the visibilty Lazarus, would acquire.

Greetings from Sao Paulo - Brazil

Ricardo

P.S.; No offense at all, please
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130321/b0fcfe13/attachment-0001.html>

Sven Barth
to Arí Ricardo Ody
Ar? Ricardo Ody wrote
He gave me, last friday, an handhelp Intermec with windows mobile 6.1.

The model was Intermec CK3a1. I installed my software in the equipment and it ran ok as expected, since it have a arm processor and windows mobile 6 or later. Next step was test the program reading barcodes via CK3a1 barcode reader. Then I go to hell. The CK3a1 read the barcode as indicated by the sound an the pilot light but nothing appears in the correspondent Lazarus edit box. I spent all weekend trying to learn what was wrong. Monday, very ashamed I told to the customer that the program was not running Ok with Intermec CK3a1. In the monday I tested with another Intermec, the CN50 model and the same error occurred. I tried with an old HP handheld and an external barcode reader attached in the slot of the HP and everything was right. The barcode read was successful.

The customer call the firm that rented the equipment and it offers to

substitute by a Cipher CP30. After a long time of tests I discover that if I open the "barcode" software(it comes with CP30) and use the barcode reader with my program, the barcode was read, but the first character of the barcode is left. The rental firm people try lots of combinations of configurations in the Cipher CP30. And the problem persists.

Wild guess: maybe the Intermec scanner is using a Windows message that is not handled by the LCL.

What you could do to check this is to use your own Window Proc and write out all messages directed to the edit control. An example is written here: http://wiki.freepascal.org/Win32/64_Interface#Example It works for WinCE also, because I'm using this to handle some custom messages as well (I don't remember which though, but they are not related to LCL controls).
If my assumption us correct then you you'll need to use this Window Proc to set the edut's text manually.

If my assumption is incorrect, then I'm afraid that I can't help you :(

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130321/5898658b/attachment.html>

Tommi Prami
to Arí Ricardo Ody: I wrote an application for WinCE in Lazarus 0.9.30/FPC 2.4.2 some time ago. Finally…
"Ar? Ricardo Ody" wrote 66 lines
I wrote an application for WinCE in Lazarus 0.9.30/FPC 2.4.2 some time ago. Finally appear a customer interested in the system. It was tested in an iPaq equipment during the development stage. Late I tested it with a Motorola ES400 handheld when I can test the functions using a barcode scanner. Everything were alright. I have the idea that my software were ready to sale even if the customer wants to use barcode scanner as data entry for some fields in my forms. Based on this I offer the software for the mentioned customer and tell him that it always have to rent(or buy) a handheld with windows mobile 6 or greater. He gave me, last friday, an handhelp Intermec with windows mobile 6.1. The model was Intermec CK3a1. I installed my software in the equipment and it ran ok as expected, since it have a arm processor and windows mobile 6 or later. Next step was test the program reading barcodes via CK3a1 barcode reader. Then I go to hell. The CK3a1 read the barcode as indicated by the sound an the pilot light but nothing appears in the correspondent Lazarus edit box. I spent all weekend trying to learn what was wrong. Monday, very ashamed I told to the customer that the program was not running Ok with Intermec CK3a1. In the monday I tested with another Intermec, the CN50 model and the same error occurred. I tried with an old HP handheld and an external barcode reader attached in the slot of the HP and everything was right. The barcode read was successful. The customer call the firm that rented the equipment and it offers to substitute by a Cipher CP30. After a long time of tests I discover that if I open the "barcode" software(it comes with CP30) and use the barcode reader with my program, the barcode was read, but the first character of the barcode is left. The rental firm people try lots of combinations of configurations in the Cipher CP30. And the problem persists. This afternoon the customer give me an ultimatum. If the software doesn't run with a correct codebar reading they will change to another program. In all cases, if I install a .net(wrote in C#) in the handhelp, the barcode is readed and is readed correct. Well people. I know that you have no duty to help me. But once more I ask for help with this problem. I believe in the same dream you believe: Write once, compile everywhere. But I still believe that the code generated will run as expected. No one in the Lazarus community can help me? Why I wrote in the mailing list, english forum and portuguese forum and nobody answer? If the ,net application and even the windows mobile application "note" read the barcode correct, is them wrong or is there something wrong with the way Lazarus and FPC talk with the WinCE(windows mobile 6 or later) I/O routines? Will WinCe change? Here are now 11:33 PM. I have 'till 12 AM tomorrow to tell something to the customer. Look here the potential customer I'll lost: http://www.votorantim.com.br/en-US/Pages/home.aspx Think about the visibilty Lazarus, would acquire. Greetings from Sao Paulo - Brazil Ricardo P.S.; No offense at all, please

Hello,

I can't help you with task at hand, but my impression of the WinCE/WindowsMobile PDA:s are that one should avoid them at all cost.

My ex Coworker has been battling with them a lot and he uses C# (Micro$oft tools!) and he has had huge problems. (I asked him which is the best WinMob-based PDA and he replied "they all are crappy", and asked him why he thinks that, he told that there are always some flaky stuff. that program works for one device and not other and so...)

I have been writing pretty simple app with Lazarus to Windows Mobile PDA and it has been struggle. From the beginning.

Had to to weird Hacks to get around weird problems. Some might be Lazarus/FPC related but never know...

Now there has been Rugged Android devices coming up. Have not seen good one with bar-code reader yet, but hope we have Lazarus-solution for Android soon, to get that kind of business the tools they need. Windows mobile based ones are just awful. the OS it self it is so ugly and difficult to work with that it is the reason it self.

If some one have more knowledge on Android Rugged PDAs and/or ability on using Lazarus on Android, hope to hear all about it (Saw something on Lazarus and Android development some time ago, but not lately, so I don't know the status of it...)

-Tee-

Michael Schnell
to Arí Ricardo Ody: I wrote an application for WinCE in Lazarus 0.9.30/FPC 2.4.2 some time ago. Finally…
"Ar? Ricardo Ody" wrote
WinCE ... a customer interested

Isn't this a contradiction, nowadays ?
I feel that WinCE is rapidly declining.

If the .net application ...

While I was intrigued when the .NET virtual machine (in fact the correct therm here is CIL rather then .NET) came up I feel that CIL now has been nearly killed by Java, even though nowadays there is decent Linux and Mac support for CIL and I still think that technically CIL is more advantageous.

-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130321/93cccf55/attachment.html>

Sven Barth
to Tommi Prami: I can't help you with task at hand, but my impression of the WinCE/WindowsMobile PDA:s…
Tommi Prami wrote 27 lines
Hello, I can't help you with task at hand, but my impression of the WinCE/WindowsMobile PDA:s are that one should avoid them at all cost. My ex Coworker has been battling with them a lot and he uses C# (Micro$oft tools!) and he has had huge problems. (I asked him which is the best WinMob-based PDA and he replied "they all are crappy", and asked him why he thinks that, he told that there are always some flaky stuff. that program works for one device and not other and so...) I have been writing pretty simple app with Lazarus to Windows Mobile PDA and it has been struggle. From the beginning. Had to to weird Hacks to get around weird problems. Some might be Lazarus/FPC related but never know... Now there has been Rugged Android devices coming up. Have not seen good one with bar-code reader yet, but hope we have Lazarus-solution for Android soon, to get that kind of business the tools they need. Windows mobile based ones are just awful. the OS it self it is so ugly and difficult to work with that it is the reason it self. If some one have more knowledge on Android Rugged PDAs and/or ability on using Lazarus on Android, hope to hear all about it (Saw something on Lazarus and Android development some time ago, but not lately, so I don't know the status of it...)

Last week I had the chance to speak to Casio workers on a mobile conference in Munich. Casio is also producing rugged industrial devices and they are now only beginning to provide Android based phones. They told me that they'll be doing a two track approach for the foreseeable time. Other companies like Motorola Solutions (aka Symbol) don't seem to want to switch to also it's not always possible to dictate your customers what devices they should choose.

Regards,
Sven

Sven Barth
to Michael Schnell: Isn't this a contradiction, nowadays ? I feel that WinCE is rapidly declining. While I…
Michael Schnell wrote
On 03/21/2013 03:46 AM, "Ar? Ricardo Ody" wrote: > WinCE ... a customer interested Isn't this a contradiction, nowadays ? I feel that WinCE is rapidly declining.

In the consumer market you are right, but not for industrial/business devices. You must not forget that much investment was done there and if you'd switch to another platform you'd have another big investment again. I've talked with Casio employees last week and they told me that Windows CE will stay for the forseeable future just because of this.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130321/0c52a6fb/attachment.html>

Michael Schnell
to Sven Barth
Sven Barth wrote
You must not forget that much investment was done there and if you'd switch to another platform you'd have another big investment again.

Yep. But do many of them think about implementing completely new Software (that could be done in fpc/Lazarus, while obviously the current is done otherwise) on such legacy machines (or development crews) ?

I've talked with Casio employees last week and they told me that Windows CE will stay for the forseeable future just because of this.

Funny...

-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130321/1dc67557/attachment.html>

Arí Ricardo Ody

----- Original Message -----

Earlier message 24 lines
From: Michael Schnell Sent: 03/21/13 05:40 AM To: Lazarus mailing list Subject: Re: [Lazarus] One last ask for help On 03/21/2013 03:46 AM, "Ar? Ricardo Ody" wrote: WinCE ... a customer interested Isn't this a contradiction, nowadays ? I feel that WinCE is rapidly declining. ---> I don't have a clear idea about it. I see lots of new handhelds with this OS. If the .net application ... While I was intrigued when the .NET virtual machine (in fact the correct therm here is CIL rather then .NET) came up I feel that CIL now has been nearly killed by Java, even though nowadays there is decent Linux and Mac support for CIL and I still think that technically CIL is more advantageous. ---> IMHO don't still buy the .net coffin. Talking about Linux and MacOS look at: http://www.mono-project.com/Main_Page My personal opinion about .net is @@ -Michael Ricardo -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130321/5aaa2e75/attachment-0001.html>
Antonio Fortuny
to Arí Ricardo Ody

Hi Ricardo.

As of my last experience (Datalogic, Motorola former Symbol models, all using WinCE) the scanner itself needs to be very carefully configured. AKAIK in all models I've tested, the barcode scanner sends the chars as if they were typed on the keyboard. Because of this it is difficult to distinguish the source: the scanner or the keyboard. That's why I have setup the scanner to send a prefix and a suffix whith the barcode itself. I use the STX and ETX special characters. In my applications the barcode itself is gathered silently because it has no meaning for the user but it is sometimes displayed in a TLabel. Anyway, in all cases I use the KeyPreview event of the form. If I get the STX all next characters are stored in a barcode string until the EOT is catched otherwise they follow the standard process and are caught by the focused control. This way I can mix, in the application, input coming from the KB (quantities, weights, etc.) and from the scanner.

To have the characters sent by the scanner into an edit field, the edit field must have the focus otherwise either the characters are lost (no input fields capable of input) or they go into a misfocused control. Do not forget (see scanner config) that usually the scanner sends a CR+LF (or only LF) after the last character of the scanning process. So focus may change too.

Antonio.

Arí Ricardo Ody

----- Original Message -----

Earlier message 9 lines
From: Antonio Fortuny Sent: 03/21/13 09:37 AM To: Subject: Re: [Lazarus] Fw: Re: One last ask for help Hi Ricardo. ---> Hi Antonio As of my last experience (Datalogic, Motorola former Symbol models, all using WinCE) the scanner itself needs to be very carefully configured. --->Can tell little bit more about this? AKAIK in all models I've tested, the barcode scanner sends the chars as if they were typed on the keyboard. Because of this it is difficult to distinguish the source: the scanner or the keyboard. ---> In my application it doesn't matter That's why I have setup the scanner to send a prefix and a suffix whith the barcode itself. I use the STX and ETX special characters. In my applications the barcode itself is gathered silently because it has no meaning for the user but it is sometimes displayed in a TLabel. ---> In my application user must see the code scanned. Are you suggesting that I can't see the code because I wait the input in a TEdit? If I use a TLabel it will be showed? Anyway, in all cases I use the KeyPreview event of the form. ---> What is the exactly use of this event in this case? I open a nem porject in Lazarus 1.0 RC1(Is the only one I have in this machine in my work) and can't find the KeyPreview event. I crate a project and put a TEdit in it. And can't find the KeyPreview? Excuse me for weak knowledge. If I get the STX all next characters are stored in a barcode string until the EOT is catched otherwise they follow the standard process and are caught by the focused control. This way I can mix, in the application, input coming from the KB (quantities, weights, etc.) and from the scanner. To have the characters sent by the scanner into an edit field, the edit field must have the focus otherwise either the characters are lost (no input fields capable of input) or they go into a misfocused control. Do not forget (see scanner config) that usually the scanner sends a CR+LF (or only LF) after the last character of the scanning process. So focus may change too. ---> I use the barcode reader with the focus in a TEdit. I'm sure of this. I've tested with a little porject with a FOrm and only a TEdit that remains waiting input. Again nothing was read. I beleive that it isn't case of CR+LF or only LF 'cause teh focus doesn't change aftger the barcode read. Which is your opinion about the fact of scanner lost the first character scanned? It occurs in another handheld model. Would it be a kind of clue about the cause of the problem at all? Thanks Antonio. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130321/2a5a3de5/attachment.html>
Antonio Fortuny
to Arí Ricardo Ody

Le 21/03/2013 15:02, "Ar? Ricardo Ody" a ?crit :

Hi Ricardo. ---> Hi Antonio As of my last experience (Datalogic, Motorola former Symbol models, all using WinCE)

the scanner itself needs to be very carefully configured. --->Can tell little bit more about this?
Depends on each model. There should be some kind of program to set the scanner config
Usually tap button Windows, on the applications screen select Settings, then there should be a program specific to the hardware having a barcode icon of so.

---> In my application user must see the code scanned. Are you suggesting that I can't see the code because I wait the input in a TEdit? No, it seems that the characters from the scaaner are not sent to the wright place
If I use a TLabel it will be showed?
You can"t manage to use a direct input as the TLabel is not input capable. You can only change the caption by assignment

---> What is the exactly use of this event in this case? set MyForm.KeyPreview to True;
set MyForm.OnKeyPress to an event (i.e. MyFormKeyPress)

procedure TMyForm.FormKeyPress(Sender: TObject; var Key: char);
begin
   case Ord(Key) of
     {$IFDEF WIN32}
     Ord('>'),  // this helps to simulate on Win32
     {$ENDIF}
     Ord(#03): begin   // aka EOT
       Key := #0;
       try
         if Scann.Buffer = EmptyStr then
           Exit;
         codebarre := scann.buffer;
         ...
         ... do whatever has to be done with the scannes barcode
         ...
       finally
         Scann.Reset;
         Scann.Reading := False;
       end
     end;
     {$IFDEF WIN32}
     Ord('<'),   // this helps to simulate on Win32
     {$ENDIF}
     Ord(#02): begin   // aka STX
       Scann.Reset;
       Key := #0;   // ignore key
       Scann.Reading := True;
     end
     else begin
       Scann.Buffer := Scann.Buffer + Key;
       Key := #0;   // ignore key
     end
   end
end;

I open a nem porject in Lazarus 1.0 RC1(Is the only one I have in this machine in my work) and can't find the KeyPreview event. see above

Sven Barth
to Antonio Fortuny
Antonio Fortuny wrote 36 lines
procedure TMyForm.FormKeyPress(Sender: TObject; var Key: char); begin case Ord(Key) of {$IFDEF WIN32} Ord('>'), // this helps to simulate on Win32 {$ENDIF} Ord(#03): begin // aka EOT Key := #0; try if Scann.Buffer = EmptyStr then Exit; codebarre := scann.buffer; ... ... do whatever has to be done with the scannes barcode ... finally Scann.Reset; Scann.Reading := False; end end; {$IFDEF WIN32} Ord('<'), // this helps to simulate on Win32 {$ENDIF} Ord(#02): begin // aka STX Scann.Reset; Key := #0; // ignore key Scann.Reading := True; end else begin Scann.Buffer := Scann.Buffer + Key; Key := #0; // ignore key end end end;

Out of curiosity: why do you use "Ord"? You can achieve the same by just using the chars:

=== code begin ===
   case Key of
     '>',
     #03: begin
       //...
     end;
     '<',
     #02: begin
       //...
     end;
     else begin
       //...
     end;
   end;
=== code end ===

Regards,
Sven

Antonio Fortuny
to Sven Barth
Show quoted text 21 lines
Out of curiosity: why do you use "Ord"? You can achieve the same by just using the chars: === code begin === case Key of '>', #03: begin //... end; '<', #02: begin //... end; else begin //... end; end; === code end === Regards, Sven

Hum, you are right. Only history. I herited if this program (and others) and I haven't yet finish to restructure it as it suffers of continous development

Show quoted text 7 lines
-- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Sven Barth
to Antonio Fortuny
Antonio Fortuny wrote 24 lines
> Out of curiosity: why do you use "Ord"? You can achieve the same by just > using the chars: > > === code begin === > case Key of > '>', > #03: begin > //... > end; > '<', > #02: begin > //... > end; > else begin > //... > end; > end; > === code end === > > Regards, > Sven Hum, you are right. Only history. I herited if this program (and others) and I haven't yet finish to restructure it as it suffers of continous development

Ah, ok :)

Regards,
Sven

Arí Ricardo Ody

Hi!

Is it possible that the presence of #02 and/or #03 in the string read by scanner cause the code read not to be showed in the corresponding edit box? I see 2 possibilities here. As below:

1. The string read by the scanner is not pssed to edit box

2. The string read by the scanner is passed to the edit box but it remains in blank 'cause of special characters #02 and/or #03.

In your opinion, wich is the most probable possibility in this case?

I confess I didn't consider the item 2 above...

Cheers

Earlier message 10 lines
----- Original Message ----- From: Antonio Fortuny Sent: 03/21/13 12:26 PM To: Subject: Re: [Lazarus] Fw: Re: One last ask for help Le 21/03/2013 15:02, "Ar? Ricardo Ody" a ?crit : > Hi Ricardo. ---> Hi Antonio As of my last experience (Datalogic, Motorola former Symbol models, all using WinCE) the scanner itself needs to be very carefully configured. --->Can tell little bit more about this? Depends on each model. There should be some kind of program to set the scanner config Usually tap button Windows, on the applications screen select Settings, then there should be a program specific to the hardware having a barcode icon of so. ---> In my application user must see the code scanned. Are you suggesting that I can't see the code because I wait the input in a TEdit? No, it seems that the characters from the scaaner are not sent to the wright place If I use a TLabel it will be showed? You can"t manage to use a direct input as the TLabel is not input capable. You can only change the caption by assignment ---> What is the exactly use of this event in this case? set MyForm.KeyPreview to True; set MyForm.OnKeyPress to an event (i.e. MyFormKeyPress) procedure TMyForm.FormKeyPress(Sender: TObject; var Key: char); begin case Ord(Key) of {$IFDEF WIN32} Ord('>'), // this helps to simulate on Win32 {$ENDIF} Ord(#03): begin // aka EOT Key := #0; try if Scann.Buffer = EmptyStr then Exit; codebarre := scann.buffer; ... ... do whatever has to be done with the scannes barcode ... finally Scann.Reset; Scann.Reading := False; end end; {$IFDEF WIN32} Ord('<'), // this helps to simulate on Win32 {$ENDIF} Ord(#02): begin // aka STX Scann.Reset; Key := #0; // ignore key Scann.Reading := True; end else begin Scann.Buffer := Scann.Buffer + Key; Key := #0; // ignore key end end end; I open a nem porject in Lazarus 1.0 RC1(Is the only one I have in this machine in my work) and can't find the KeyPreview event. see above -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130321/6338d528/attachment-0001.html>
Hans-Peter Diettrich
to Arí Ricardo Ody
Show quoted text 7 lines
> procedure TMyForm.FormKeyPress(Sender: TObject; var Key: char); > begin > case Ord(Key) of > {$IFDEF WIN32} > Ord('>'), // this helps to simulate on Win32 > {$ENDIF} > Ord(#03): begin // aka EOT

I'd suspect that #3 never occurs in KeyPress, because it's a control character. Did you try KeyDown instead?

DoDi