Click here to Skip to main content
Click here to Skip to main content

CHM Reader for Pocket PC 2003

By , 29 Feb 2004
 

Sample Image - pic004.jpg

Introduction

I have started to study for the MCAD. So after getting the books (I cannot afford the training courses), I started to read. However, as life is busy, I either had to carry a number of heavy books around, or sit in front of a PC which is not always possible. I was then lucky enough to get a Pocket PC for Christmas. But Pocket PCs do not come with a CHM Reader, and the ones available on the web are not free, or do not handle large CHM files well. So I decided to write my own and this is the result. A free CHM Reader which can handle large CHM files (Tested up to 14Mb in size). This program has only been tested on the Pocket PC 2003 on an IPaq 5550.

The Code

This CHM Reader is a MFC Doc List application, which uses a number of good libraries.

  • Virtual Office Systems Incorporated - VOImage, VOString & VORegistry classes
  • Vassili Philippov - CSTHtmlDialog
  • Jed Wing - The CHMLib Library
  • João Paulo Figueira [joao.figueira@vianw.pt] - General Help

Thanks to all these people for the great code they have contributed to the web.

CHMReader first displays a DocList (MFC's) of all the CHM files in the selected directory of the PocketPC. When the user selects one of them, MFC creates a new CCHMReaderDoc instance which will then use CCHMFile class. This class handles the CHMLib library. The CHM file is then opened, and the CCHMFile class will build a list of all the files contained in the CHM file. It also builds a Tree list of the contents. This is then displayed in the CCHMReaderView class. This shows the contents of the CHM File. The user can then select one of the items in the contents, and a new dialog is displayed. This dialog contains the Pocket PC Internet Explorer control. The HTML file is extracted from the CHM file using the CCHMFile class & the CHMLib library. The HTML is also scanned for any Style Sheet entries. These are then also extracted from the CHM file. Then the IE control is initialized with the HTML for display.

One thing to note is that the images are extracted from the CHM file as the IE control needs them. When the IE control loads the HTML, it will ask for each image in turn by way of a notification message. When I handle the notification, I simply extract the image from the CHM file into a buffer. It is then uncompressed using the VOImage class. It is then passed back to the IE control.

Sample screenshot

Sample screenshot

Extras

I also added a few simple extras like the ability to change the text size, toggle 'Clear Text' & 'Fit to Window' as these are all implemented by the IE control. I also added '<' and '>' buttons to the toolbar to allow the user to navigate back and forth in the contents list easily.

Also note: If one CHM file requires files from other CHM files (Windows CHM Help Files) then if the files are present, CHMReader will try to get the files required, but it does not always.

Installation

Just copy the CHMReader.EXE & any CHM files to your PocketPC, and run.

Build Environment

To build the CHMReader, I used embedded Visual C V4 SP2.

History

  • V1.0 - 9 Feb 2004 - First release
  • V1.01 -11 Feb 2004 - Bug fixes - Incorrectly handling images which where not found in CHM file.
  • V1.03 - 18 Feb 2003 - Bug fixes - Pocket Internet Explorer does not handle script or XML tags, so I removed them from the HTML code before I pass it to the HTML code. Also links to other parts of the CHM file did not work correctly. Now fixed.
    • 24 Feb 2003 - Added download for PocketPC2002 OS

Extra Downloads

For the most current downloads, please download from here.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Peter Tewkesbury
Software Developer (Senior)
United Kingdom United Kingdom
Member
Hi, I am a developer working in Cheshire, England. I started programming on a Vic-20 back in the 80's with only 5K of ram), and I have not looked back since. I have developed software using Visual C/C++, C#/.NET, MFC, ATL & ASP.NET, SQL Server, Crystal Reports, DevExpress .NET Components, WinForms, SQL Server client side reporting.
 
My favourite language is C# on .NET V3.5 and I am always trying to learn new stuff like LINQ.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
Generalnothing but all these error messages with vs2008: this is a very bad source code sample!!memberMember 134497510 May '09 - 0:17 
GeneralRe: nothing but all these error messages with vs2008: this is a very bad source code sample!!memberPeter Tewkesbury17 May '09 - 5:54 
GeneralCould not compile source code, undeclared identifiersmemberMember 450990520 Dec '08 - 17:19 
GeneralRe: Could not compile source code, undeclared identifiersmemberPeter Tewkesbury21 Dec '08 - 20:53 
AnswerCould you help me about my chm reader .thank you [modified]memberlusure26 Nov '08 - 14:04 
GeneralRe: Could you help me about my chm reader .thank youmemberPeter Tewkesbury26 Nov '08 - 22:10 
GeneralRe: Could you help me about my chm reader .thank youmemberlusure27 Nov '08 - 20:39 
QuestionHow to thumbnail viewmemberWillian Hall26 Aug '08 - 14:52 
AnswerRe: How to thumbnail viewmemberPeter Tewkesbury26 Aug '08 - 22:30 
QuestionExceptionmemberJackey_shao8 Aug '07 - 23:11 
AnswerRe: ExceptionmemberPeter Tewkesbury8 Aug '07 - 23:35 
GeneralRe: ExceptionmemberJackey_shao8 Aug '07 - 23:42 
Generaltn18115@yahoo.commembertutk1_phochome4 Jul '07 - 18:15 
GeneralUsing on ipaq 1910membergolem10015 Feb '07 - 3:33 
GeneralFor Nokia 9300 [Symbian]memberrkumar32 Jan '07 - 23:26 
GeneralThank you very muchmemberafcinza10 Dec '06 - 5:29 
GeneralRe: Thank you very muchmemberPeter Tewkesbury11 Dec '06 - 5:23 
QuestionRe: Thank you very muchmemberrkumar33 Jan '07 - 22:39 
GeneralRe: Thank you very muchmemberUrbanaussie11 Feb '08 - 17:58 
QuestionDisplay PicturesmemberKiwiDi16 Nov '06 - 0:52 
AnswerRe: Display PicturesmemberPeter Tewkesbury17 Nov '06 - 3:03 
GeneralRe: Display PicturesmemberKiwiDi21 Nov '06 - 5:06 
QuestionHelp, IE activex control ?memberg venu19 Oct '06 - 4:10 
AnswerRe: Help, IE activex control ?memberPeter Tewkesbury19 Oct '06 - 21:33 
GeneralOverflow exceptionmemberJohn Dough9 Oct '06 - 8:13 
GeneralRe: Overflow exceptionmemberPeter Tewkesbury9 Oct '06 - 21:40 
GeneralRe: Overflow exceptionmemberJohn Dough11 Oct '06 - 6:10 
QuestionHelp RequiredmemberK.HARIKRISHNA13 Jun '06 - 3:01 
AnswerRe: Help RequiredmemberPeter Tewkesbury14 Jun '06 - 2:13 
GeneralRe: Help RequiredmemberJackey_shao8 Aug '07 - 21:08 
GeneralRe: Help RequiredmemberPeter Tewkesbury8 Aug '07 - 23:35 
GeneralHelp Required..memberSreekanth Muralidharan7 Dec '05 - 23:42 
GeneralRe: Help Required..memberPeter Tewkesbury8 Dec '05 - 21:51 
GeneralRe: Help Required..memberSreekanth Muralidharan11 Dec '05 - 16:59 
GeneralPerfect, mostlysussMondor11 Sep '05 - 11:11 
GeneralRe: Perfect, mostlymemberPeter Tewkesbury18 Sep '05 - 21:57 
QuestionCan it be tansplanted to wince.net?memberdaemon200623 Aug '05 - 23:43 
AnswerRe: Can it be tansplanted to wince.net?memberPeter Tewkesbury25 Aug '05 - 3:02 
QuestionNeed help?memberRNick14 Aug '05 - 7:03 
AnswerRe: Need help?memberPeter Tewkesbury14 Aug '05 - 21:27 
GeneralSuggestion: fit-to-window featuresussJohn Hawk7 Aug '05 - 19:31 
GeneralRe: Suggestion: fit-to-window featurememberPeter Tewkesbury8 Aug '05 - 21:48 
GeneralRe: Suggestion: fit-to-window featurememberpinxue23 Feb '06 - 18:56 
GeneralTestmemberAbdullahVB30 Jul '05 - 22:10 
GeneralNothing to say! Just a great job!memberGeorge Mamaladze16 Jun '05 - 11:40 
GeneralGreat ToolmemberGhazi Al Wadi2 May '05 - 23:00 
GeneralThanksmemberzagwazatha16 Jun '05 - 6:57 
GeneralTrouble with cyrillicmemberShuriC@pda.by27 Mar '05 - 22:42 
GeneralRe: Trouble with cyrillicmemberPeter Tewkesbury7 Apr '05 - 21:27 
Generalimprove the performance dramaticallymemberpinxue9 Mar '05 - 18:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 1 Mar 2004
Article Copyright 2004 by Peter Tewkesbury
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid