Click here to Skip to main content
6,292,811 members and growing! (11,219 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » Mobile Development » Applications     Intermediate

CHM Reader for Pocket PC 2003

By Peter Tewkesbury

Allows the reading of CHM files on a Pocket PC2003.
VC6, VC7.1, eVC 4.0, Windows, Win Mobile (PocketPC 2002, WinMobile2003), MFC, VS.NET2003, Dev
Posted:8 Feb 2004
Updated:29 Feb 2004
Views:265,907
Bookmarked:79 times
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
64 votes for this article.
Popularity: 7.93 Rating: 4.39 out of 5
4 votes, 6.3%
1
1 vote, 1.6%
2

3
4 votes, 6.3%
4
55 votes, 85.9%
5

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Peter Tewkesbury


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 currently develop in Visual C/C++, C#/.NET, MFC, ATL & ASP.NET, SQL Server, Crystal Reports, DevX, WinForms.
Occupation: Software Developer
Location: United Kingdom United Kingdom

Other popular Mobile Development articles:

  • Writing Your Own GPS Applications: Part 2
    In part two of the series, the author of "GPS.NET" teaches developers how to write GPS applications suitable for the real world by mastering GPS precision concepts. Source code includes a working NMEA interpreter and sample high-precision application in C# and VB.NET.
  • Writing Your Own GPS Applications: Part I
    What is it that GPS applications need to be good enough to use for in-car navigation? Also, how does the process of interpreting GPS data actually work? In this three-part series, I will cover both topics and give you the skills you need to write a commercial-grade GPS application.
  • Learn How to Find GPS Location on Any SmartPhone, and Then Make it Relevant
    A step by step tutorial for getting GPS from any SmartPhone, even without GPS built in, and then making location useful.
  • Pocket 1945 - A C# .NET CF Shooter
    An article on Pocket PC game development
  • iPhone UI in Windows Mobile
    It's an interface that works with transparency effects. As a sample I used an interface just like the iPhone one. In this tutorial I am explaining how simple is working with transparency on Windows Mobile.
Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 142 (Total in Forum: 142) (Refresh)FirstPrevNext
Generalnothing but all these error messages with vs2008: this is a very bad source code sample!! PinmemberMember 13449751:17 10 May '09  
GeneralRe: nothing but all these error messages with vs2008: this is a very bad source code sample!! PinmemberPeter Tewkesbury6:54 17 May '09  
GeneralCould not compile source code, undeclared identifiers PinmemberMember 450990518:19 20 Dec '08  
GeneralRe: Could not compile source code, undeclared identifiers PinmemberPeter Tewkesbury21:53 21 Dec '08  
AnswerCould you help me about my chm reader .thank you [modified] Pinmemberlusure15:04 26 Nov '08  
GeneralRe: Could you help me about my chm reader .thank you PinmemberPeter Tewkesbury23:10 26 Nov '08  
GeneralRe: Could you help me about my chm reader .thank you Pinmemberlusure21:39 27 Nov '08  
GeneralHow to thumbnail view PinmemberWillian Hall15:52 26 Aug '08  
GeneralRe: How to thumbnail view PinmemberPeter Tewkesbury23:30 26 Aug '08  
QuestionException PinmemberJackey_shao0:11 9 Aug '07  
AnswerRe: Exception PinmemberPeter Tewkesbury0:35 9 Aug '07  
GeneralRe: Exception PinmemberJackey_shao0:42 9 Aug '07  
Generaltn18115@yahoo.com Pinmembertutk1_phochome19:15 4 Jul '07  
GeneralUsing on ipaq 1910 Pinmembergolem1004:33 15 Feb '07  
GeneralFor Nokia 9300 [Symbian] Pinmemberrkumar30:26 3 Jan '07  
GeneralThank you very much Pinmemberafcinza6:29 10 Dec '06  
GeneralRe: Thank you very much PinmemberPeter Tewkesbury6:23 11 Dec '06  
QuestionRe: Thank you very much Pinmemberrkumar323:39 3 Jan '07  
GeneralRe: Thank you very much PinmemberUrbanaussie18:58 11 Feb '08  
QuestionDisplay Pictures PinmemberKiwiDi1:52 16 Nov '06  
AnswerRe: Display Pictures PinmemberPeter Tewkesbury4:03 17 Nov '06  
GeneralRe: Display Pictures PinmemberKiwiDi6:06 21 Nov '06  
GeneralHelp, IE activex control ? Pinmemberg venu5:10 19 Oct '06  
GeneralRe: Help, IE activex control ? PinmemberPeter Tewkesbury22:33 19 Oct '06  
GeneralOverflow exception PinmemberJohn Dough9:13 9 Oct '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 29 Feb 2004
Editor: Smitha Vijayan
Copyright 2004 by Peter Tewkesbury
Everything else Copyright © CodeProject, 1999-2009
Web10 | Advertise on the Code Project