Re: [fpc-pascal] Any Way to catch endless loop in fpc in Wince?

2009-11-11 Thread epergola


I mean at runtime, where the app is deployed, not in the Lazarus IDE
debugger.

-- 
View this message in context: 
http://old.nabble.com/Any-Way-to-catch-endless-loop-in-fpc-in-Wince--tp26293620p26297681.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Any Way to catch endless loop in fpc in Wince?

2009-11-10 Thread epergola

Hi
Is there a way (or a 3rd party component or a library) to catch an endless
loop after x seconds
in applications running on arm Wince?

-- 
View this message in context: 
http://old.nabble.com/Any-Way-to-catch-endless-loop-in-fpc-in-Wince--tp26293620p26293620.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Does GetLastError in WinCE work? NO answer??

2009-11-02 Thread epergola

Is this the wrong forum?

Can anybody help with my question? If I should send it to another forum,
please
tell me which one.
Thanks


epergola wrote:
 
 Hello
 I get strange results form GetLasError in WinCe;
 something like 1449435930, for example;
 
 I use this:
 {$include d:\lazarus\fpc\2.2.4\source\rtl\wince\wininc\coredll.inc} 
 function GetLastError:DWORD; external KernelDLL name 'GetLastError'; 
 
 var
  err: dword;
 
 begin
 MutexHandle := CreateMutex(NIL, TRUE, 'xxx');
 err:= GetCeError;
 if err = ERROR_ALREADY_EXISTS  THEN BEGIN
   SetForegroundWindow(FindWindow('xxx', ''));
   CloseHandle(MutexHandle);
   Application.BringToFront;
 END ELSE BEGIN
   .
 Am I missing something? 
 Why do I get those huge values from GetLastError?
 Thanks for any help
 

-- 
View this message in context: 
http://old.nabble.com/Does-GetLastError-in-WinCE-work--tp26124267p26157812.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Does GetLastError in WinCE work?

2009-10-29 Thread epergola

Hello
I get strange results form GetLasError in WinCe;
something like 1449435930, for example;

I use this:
{$include d:\lazarus\fpc\2.2.4\source\rtl\wince\wininc\coredll.inc} 
function GetLastError:DWORD; external KernelDLL name 'GetLastError'; 

var
 err: dword;

begin
MutexHandle := CreateMutex(NIL, TRUE, 'xxx');
err:= GetCeError;
if err = ERROR_ALREADY_EXISTS  THEN BEGIN
  SetForegroundWindow(FindWindow('xxx', ''));
  CloseHandle(MutexHandle);
  Application.BringToFront;
END ELSE BEGIN
  .
Am I missing something? 
Why do I get those huge values from GetLastError?
Thanks for any help
-- 
View this message in context: 
http://old.nabble.com/Does-GetLastError-in-WinCE-work--tp26124267p26124267.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Please Help with inifile in WinCE (ReadSectionValues into stringlist)

2009-09-12 Thread epergola

Hi
I have a small translation file (pure ASCII DOS text) written in Win32. I
copied it to the emulator with Activesync.
The file contains one sections ('f') in this format
[f]
'Language||idioma'.  (etc.)
(i.e. the English test on the 1st half, the Spanish translation on the 2nd
half)
In the WinCE test program run on the emulator, I read it this way:

 IniFile := TIniFile.Create(s) ;
  tl:=TStringList.Create;
  try
inifile.ReadSectionValues('f',tL);
for i:=0 to tl.Count-1 do begin
   tl[i]:=ConvertEncoding(tl[i],GuessEncoding(tl[i]),EncodingAnsi);
   memo1.lines.add(tl[i]);  
Now all works fine when the (2nd half) Spanish part has only english
characters.
But when there are spanish special characters  (accented A or O and similar)
the tl[]
line is not written to memo1 at all.
I assume the inifile in Wince is widestring UTF* encoded, so i tried to
convert it
to ansi encoding but AFTER the tl string list is already populated. Is this
the problem?
If so, what should I ReadSectionValues into different form TStringList?
If the problem is other, can anyone give me clue? 
Thanks very much for any help

-- 
View this message in context: 
http://www.nabble.com/Please-Help-with-inifile-in-WinCE-%28ReadSectionValues-into-stringlist%29-tp25411974p25411974.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] WinCE: Detect if a PDA is connected to a LAN WI-FI peer-to-pear

2009-08-27 Thread epergola

Hi

1. Is it possible to detect if a PDA is connected (wi-fi) to a peer-to-peer
LAN (by IP or Device 
name)?
If yes, how? maybe by a ping? is there a programmatic ping method?
2.How to detect the IP of a PDA from an App running on the same PDA? In a
peer-to-peer
   LAN, is the PDA IP static like for the workstations?
Basically, what I'd like to do is to  retrieve the IP of the PDA  when the
user on the PDA makes a change to a data file on the desktop server (via
sockets)  I want to store the IP of the PDA (if static) or its Device name
(which I know I can retrieve from the PDA registry) if the IP
keeps changing. 
If necessary, I need to see in a subsequent moment if the PDA is still
connected to the LAN
(with a ping or other method).
Thanks for any help. 
-- 
View this message in context: 
http://www.nabble.com/WinCE%3A-Detect-if-a-PDA-is-connected-to-a-LAN-WI-FI-peer-to-pear-tp25179819p25179819.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Does Anybody Know how to REALLY kill an App on Pocket Pc?

2009-08-26 Thread epergola

Felipe 
thanks, but i found the perfect solution, I think.
Actually the indo ia from lyh1 in a post in Lazarus forum (titled
'FullScreen Application').
If in resetpda I use
hkeyboard:=FindWindow('menu_worker',''); 
instead of 
 hkeyboard:=FindWindow('MS_SIPBUTTON','MS_SIPBUTTON');
it works like a charm. 
Calling resetpda(false) in MainForm.FormCreate and resetpda(true) in
in Finalization of MainForm makes the keyboard button disappear for the
duration
of the App.



Felipe Monteiro de Carvalho wrote:
 
 LCL-wince does not activate the keyboard upon closing a modal form,
 Windows CE does this alone and I dont know if this can be prevented.
 
 Why dont you just call resetpda in OnActivate? (or both OnCreate and
 OnActivate)
 
 -- 
 Felipe Monteiro de Carvalho
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal
 
 

-- 
View this message in context: 
http://www.nabble.com/Does-Anybody-Know-how-to-REALLY-kill-an-App-on-Pocket-Pc--tp25107234p25151462.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Does Anybody Know how to REALLY kill an App on Pocket Pc?

2009-08-25 Thread epergola

Felipe thanks very much!
Since you are *the* man for arm dev in fpc (as I read), could you please
take a look at the
previous post Status of SipShowIM (software keyboard)?.
More than SipShoiwIM, I would like to know how to ensure that the
Findwindow/Showwindow 
keep the keyboard hidden for the duration of the App.
Now, the resetpda on FormCreate of Main form hides it. 
It is kept hidden when  I call Form2.showmodal in Main Form.
But when I close Form 2, the keyboard re-appears on top of MainForm!
(you can move resetpda from FormActivate to FormCreate, then run the test
code
I sent previously to reproduce the problem).
Thanks


Felipe Monteiro de Carvalho wrote:
 
 Was trivial to solve, you are not turning off the full screen mode
 before shutting the application down, so the upper panels are not
 painted and the old painting remains. The application is either way
 really closed, but because you shut down the panels, nothing shows up
 to cover the old paint.
 
 Just add this to the end of your unit:
 
 finalization
   resetpda(true);
 
 And any of the close method ( Self.Close or Application.Terminate)
 will work properly
 
 -- 
 Felipe Monteiro de Carvalho
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal
 
 

-- 
View this message in context: 
http://www.nabble.com/Does-Anybody-Know-how-to-REALLY-kill-an-App-on-Pocket-Pc--tp25107234p25137766.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Does Anybody Know how to REALLY kill an App on Pocket Pc?

2009-08-24 Thread epergola

Yes I could. But where and how would 'publish' it?
can I zip the source, use 'Reply' and then 'Upload File' when n replying?


Felipe Monteiro de Carvalho wrote:
 
 Can you publish a test application somewhere demonstrating the problem?
 
 -- 
 Felipe Monteiro de Carvalho
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal
 
 

-- 
View this message in context: 
http://www.nabble.com/Does-Anybody-Know-how-to-REALLY-kill-an-App-on-Pocket-Pc--tp25107234p25120281.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Does Anybody Know how to REALLY kill an App on Pocket Pc?

2009-08-24 Thread epergola

Trying to upload the test files.
Sent them wherever Upload File puts them..

http://www.nabble.com/file/p25120976/fpctest.rar fpctest.rar 

epergola wrote:
 
 Yes I could. But where and how would 'publish' it?
 can I zip the source, use 'Reply' and then 'Upload File' when n replying?
 
 
 Felipe Monteiro de Carvalho wrote:
 
 Can you publish a test application somewhere demonstrating the problem?
 
 -- 
 Felipe Monteiro de Carvalho
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Does-Anybody-Know-how-to-REALLY-kill-an-App-on-Pocket-Pc--tp25107234p25120976.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Does Anybody Know how to REALLY kill an App on Pocket Pc?

2009-08-23 Thread epergola

Hi

I have done a lot of research but couldn't find a solution.
I have an app that runs on a PDA and takes (must take) the whole screen.
When the user presses the Terminate button, the main window of the 
app remains visible (and I read the app actually remains in memory).
Is it possible to really terminate the app, i.e. remove it form window, and
actually
remove the main window?
Thanks
-- 
View this message in context: 
http://www.nabble.com/Does-Anybody-Know-how-to-REALLY-kill-an-App-on-Pocket-Pc--tp25107234p25107234.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Does Anybody Know how to REALLY kill an App on Pocket Pc?

2009-08-23 Thread epergola

Thanks Henry.
But my main form is full screen: no title bar, no task bar. 
I have a custom'Terminate' button that on click does this:
MainForm.Close.
I want the form to be closed (NOT appearing on the background), and the
Application
actually terminated 'destroyed' or 'killed'.
On the page you referred me to I found:
The OK button will send a WM_COMMAND message, which is handled on
wincecallback.inc, with wID=IDOK. There we respond by throwing a WM_CLOSE to
the form. 

Ok, do you know then how can I programmatically send a WM_COMMAND and
'throw' 
a WM_CLOSE (assuming this actually terminates the app)? Which unit should I
use?

-- 
View this message in context: 
http://www.nabble.com/Does-Anybody-Know-how-to-REALLY-kill-an-App-on-Pocket-Pc--tp25107234p25108463.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Does Anybody Know how to REALLY kill an App on Pocket Pc?

2009-08-23 Thread epergola

Amir
I did use Application.Terminate, but it only 'suspends' the App; The full
screen stays on the background, and the process appears to reamin in memory.


why don't you use Application.Terminate;?



-- 
View this message in context: 
http://www.nabble.com/Does-Anybody-Know-how-to-REALLY-kill-an-App-on-Pocket-Pc--tp25107234p25110547.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPCONNECT NOT WORKING?

2009-08-21 Thread epergola

Sorry, you are right.
I am using non blocking sockets (lNet library), no visual package, on the
wince-arm
side, attempting to communicate with a non blocking (Delphi) socket on my
PC.
Everything works fine (did a lot of data send and receive) except that 
fpconnect with correct address (PC computer name) and port number still
returns 
-1. 
Hence, this lines in the lNet lib (modified by me)
if SetupSocket(APort, Address) then begin
i:=fpConnect(FHandle, psockaddr(@FAddress), SizeOf(FAddress));
if i=0 then
  FConnecting := True;
Result := FConnecting;
  end;   
will always return false for the Connect function.
The original code in lNet was
if SetupSocket(APort, Address) then begin
pConnect(FHandle, psockaddr(@FAddress), SizeOf(FAddress));
FConnecting := True;
Result := FConnecting;
  end;   
which always returned TRUE, even when fpconnect fails;
Any idea as to what I may check (beside the return code of fpconnect which
does not work)
to see if the conneccion actually took place?
Thanks 

more information
linux? windows?
blocking or nonblocking sockets?

-- 
View this message in context: 
http://www.nabble.com/FPCONNECT-NOT-WORKING--tp25073238p25083432.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Status of SipShowIM (software keyboard)?

2009-08-21 Thread epergola

Hi

In the wicki Wince Ptogramming tips
(http://wiki.freepascal.org/WinCE_Programming_Tips#Show.2FHide_SIP_Panel) I
find:

Show/Hide SIP Panel
SIP: Software Input Panel button, it is a keyboard come with WinCE for touch
screen devices.
const
  //some of consts already found in Windows
  SIPF_OFF= $;
  SIPF_ON = $0001;
  SIPF_DOCKED = $0002;
  SIPF_LOCKED = $0004;
 
function SipShowIM(IPStatus:DWORD):Integer; stdcall; external 'coredll.dll'
name 'SipShowIM';
begin
  SipShowIM(SIPF_ON)
end;
Yet in coredll.inc or fpc 2.2.4 SipShowIM is listed as a 'to do'.
In fact a call SipShowIM(SIPF_ON) that I put in the FormCreate of my
mainform does not hide
the keyborad.
What is the status of this method?
Alternatively, I tried to use this:
  hkeyboard:=FindWindow('MS_SIPBUTTON','MS_SIPBUTTON');
  if hkeyboard 0 then BEGIN
ShowWindow(hkeyboard,SW);
EnableWindow(hkeyboard, showit);
  end;
This works, but only the first time: I open the MainForm, the keyboard is
not shown.
Open Form 2, keyboard not shown. When I close form2 and return to MainForm,
it shows!
Although I have the above call on each form disactivate and activevate
events.
Any suggestion on how to hide the keyboard for the duration of the App?
Thanks
-- 
View this message in context: 
http://www.nabble.com/Status-of-SipShowIM-%28software-keyboard%29--tp25087200p25087200.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] FPCONNECT NOT WORKING?

2009-08-20 Thread epergola

I am using lnet (non visual) with Lazarus, 
and in the connect process, lnet calls
fpConnect(FHandle, psockaddr(@FAddress), SizeOf(FAddress)); 
fpconnect is a FreePascal function (I could not step into it with F7).
The problem is that whether it actually connects (passing correct address
and correct port)
or not (passing correct address but wrong port) it always returns -1.
Why?
What can I check to see if a connection is ACTUALLY established between the
(Delphi)
ServerSocket and the Lazarus Client socket? (My Delphi serversocket writes
to a memo all 
messages received and sent, so i know that with the WRONG port nothing was
sent nor 
received since when connected the memo show Client Connected and
Accepted).
I saw a post dated 2008 asking about this error (bug?), but I saw no answer.
Anybody can help?
Thans
-- 
View this message in context: 
http://www.nabble.com/FPCONNECT-NOT-WORKING--tp25073238p25073238.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal