Forum > PDAs and Smartphones

WinCE progress

<< < (4/4)

Update: the thread seems to be running fine this way! But I can't really test since now file operations are very unstable.

I've got a TStringList, and I use LoadFromFile to load a text file (path correct). One should think that this is simple - but every second time or so, I get an EFOpenError exception - every other time it just loads. I replaced the mystringlist.LoadFromFile with a filestream that I opened with fmOpenRead and fmOpenShareDenyNone, and then used mystringlist.LoadFromStream, but this also throws an exception every second time.

At least this problem did not happen when I used the full Lazarus version ;)

--- Code: ---procedure TMyApp.DoLoadButton;
var sl: TStringList;
    i: integer;
   sl := TStringList.Create;
   for i := 0 to Pred(sl.Count)
    do AddListBoxItem(hList,sl[i]);
--- End code ---

* DoLoadButton is an event handler called when pressing a button on the form
* AddListBoxItem is my mini frameworks function to add strings to a ListBox, and works on other buttons
* test.txt is an existing file, the error message shows the correct path:

An unhandled exception occured at $000.....: EFOpenError: Unable to open file "\Storage Card\test\test.txt" $000.....

At the same time, using AssignFile, Reset, Read, CloseFile works - so there's probably some kind of problem in higher level file routines!

(update: submitted a bug to the bugtracker, category RTL, with a most simplified test application)

Just to update for those who use the search function ;) :
The file bug was already fixed in Subversion, and for getting real fullscreen, there's this function:

--- Code: ---const SHFS_SHOWTASKBAR = $1;

function SHFullScreen(hwmdRequester: hWnd; dwState: DWord): WINBOOL; external UserDLLAyg name 'SHFullScreen';
--- End code ---

I guess it should be in a future version of ;)

This allows to use the two buttons at the bottom created by SHCreateMenuBar (with SHFullScreen and the appropriate parameters, they will only show on smartphones, not regular devices).


[0] Message Index

[*] Previous page

Go to full version