[Windows Mobile Apps and Games] bluenote73:
A bug?

Hey Jim

I'd fallen out of the habit of reading most nights before bed, but lately I've taken it back up. One thing I found very annoying was the "open freda, (auto book open), (repaginate, I think?), hold for menu, rotate, (wait for repaginate)" sequence that I had to go through every time I started up.

My work around was a little mort script that sets my preferred reading orientation, then executes freda, waits, and then returns to my default orientation when I exit freda.

Now, that really only means anything to me, but , it's caused me no end of problems that I've just realized the nature of. I started trying to read a new book last night, and I would get nothing but crashes from freda. I tried reconverting epubs, I tried finding different copies and versions, for hours, to no avail. In the end I even hunted out another windows mobile epub reader to test my file(s).

Today inspiration struck and I figured out , I think, (mostly) what the problem is.

It seems, the graphic cover, being displayed in landscape mode, causes a crash.

If I start freda in the normal orientation, the book works. if I open the book to the cover page in the landscape orientation, crash. Once I've gotten by that page everything seem to work properly regardless of orientation.

I'm guessing this has something to do with the fact that the graphic cannot properly or easily be resized to display in landscape. I ran quite a few log files and they all looked generally the same.

Here's the latest though:

20/12/10 6:20 PM: Read from registry: program file is in folder \Internal Storage\Program Files\Freda
20/12/10 6:20 PM: Exception reading SlovoEd dictionary location from registry:
NullReferenceException
at Freda2.Program.LoadRegistryInfo()
at Freda2.Program.Main(String[] args)

20/12/10 6:20 PM: Assuming SlovoEd is at \Program Files\SlovoEd 7\SlovoEd.exe
20/12/10 6:20 PM: SlovoEd program not found at \Program Files\SlovoEd 7\SlovoEd.exe
20/12/10 6:20 PM: SlovoEd dictionary will not be available for lookup
20/12/10 6:20 PM: Initialisation completed. Version=2.0 104 WM6
20/12/10 6:20 PM: LoadBook: bookId=''
20/12/10 6:21 PM: LoadBook: bookId='file://\Internal Storage\ebooks\Knife of dreams - Robert Jordan.epub'
20/12/10 6:21 PM: LoadOpfFromEpub has found a new bookId for book file://\Internal Storage\ebooks\Knife of dreams - Robert Jordan.epub (previous id: file://\Internal Storage\ebooks\Knife of dreams - Robert Jordan.epub, new id: 19b0dbf1-15ac-401b-900a-4d02c1a0ac30)
20/12/10 6:21 PM: LoadBook: OPF file has provided a new ID (19b0dbf1-15ac-401b-900a-4d02c1a0ac30) for the book formerly known as 'file://\Internal Storage\ebooks\Knife of dreams - Robert Jordan.epub'. Changing ID.
20/12/10 6:21 PM: Error while attempting to delete folder when deleting book from bookshelf: \Internal Storage\Program Files\Freda\temp\file____Internal_Storage_ebooks_Knife_of_dreams___Robert_Jordan_epub
IOException
at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive)
at System.IO.Directory.Delete(String path, Boolean recursive)
at Freda2.Bookshelf.Delete(String _bookId)
at Freda2.FredaLibrary.Delete(String bookId)
at Freda2.FredaLibrary.ChangeBookId(String oldId, String newId)
at Freda2.FredaBook.LoadBook()
at Freda2.FredaBook.DoSomeWork()
at Freda2.FredaBook.DoWork()

20/12/10 6:21 PM: LoadBook: bookId='19b0dbf1-15ac-401b-900a-4d02c1a0ac30'
20/12/10 6:21 PM: LoadBook: bookId='19b0dbf1-15ac-401b-900a-4d02c1a0ac30'
20/12/10 6:21 PM: HandleUnexpectedError is exiting from context 'in FredaDisplay_Paint', following exception:

An error message is available for this exception but cannot be displayed because these messages are optional and are not currently installed on this device. Please install ‘NETCFv35.Messages.EN.wm.cab’ for Windows Mobile 5.0 and above or ‘NETCFv35.Messages.EN.cab’ for other platforms. Restart the application to see the message.
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Freda2.Chapter.PageNumberForWord(Int32 w)
at Freda2.FredaBook.RenderPage(WordRef wr, Boolean& wrReferencesValidPage)
at Freda2.FredaDisplay.FredaDisplay_Paint(Object sender, PaintEventArgs e)
at System.Windows.Forms.Control.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.ContainerControl.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Form.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
at System.Windows.Forms.Application.Run(Form fm)
at Freda2.Program.Main(String[] args)

20/12/10 6:21 PM: Exit() called; application will halt.
20/12/10 6:21 PM: Unexpected exception loading chapter data from EPUB data: file://\Internal Storage\ebooks\Knife of dreams - Robert Jordan.epub
ThreadAbortException
at System.String.FillString(String destString, Int32 destPos, String srcString)
at System.String.AppendInPlace(String value, Int32 currentLength)
at System.Text.StringBuilder.Append(String value)
at Freda2.Word.set_s(String value)
at Freda2.FredaBook.HandleClosingTag(String closeTagName, Int32 chapterNumber, TrivialDeclarationsInScope& inScope2, Boolean& inHeading, Boolean& inBody, Boolean& inParagraph, Boolean& inList, Direction& textDirection, List`1& internalStyleSheets2, String& internalStyleSheetText, String& anchorHref)
at Freda2.FredaBook.LoadHtmlChapterFromByteArray(Int32 chapterNumber, Byte[] htmlData, String bookId, Boolean bookIsEpubArchive)
at Freda2.FredaBook.LoadEpubChapterFromArchive(Int32 chapterNumber, String bookId)
at Freda2.FredaBook.LoadChapter(Int32 ch)
at Freda2.FredaBook.DoSomeWorkOnChapter(Int32 ch)
at Freda2.FredaBook.DoSomeWork()
at Freda2.FredaBook.DoWork()

thanks for a great product jim

Cory