Microsoft HomeproductssearchsupportshopWrite Us   Microsoft Home
Magazine
 |  Community
 |  Workshop
 |  Tools & Samples
 |  Training
 |  Site Info

Component Development

Percy Sample

Download sample

Description

Percy is an ATL2.0 control that demonstrates the use of IPersistHistory, so that state can be retained if the page containing the control is returned to using the back button.

More Details

Percy is a subclassed edit control. Having built the control, load percyctl.htm into a browser to see it work. On navigation away from the page, IPersistHistory::SaveHistory() is called, supplying a stream into which data should be saved. On return IPersistHistory::LoadHistory() is called so that state can be reloaded.

Note: Only nineteen bytes of data are loaded in the LoadHistory implementation of Percy to load into a temporary buffer.

Percy also implements IObjectSafety specifically to allow IPersistHistory to be used without any security warning dialogs, as Percy is a safe control.

Browser/Platform Compatibility

The Percy sample will compile and run on Win32 platforms with Internet Explorer 4 or Internet Explorer 5.

NOTE: Due to an incompatibility between VC 6.0 ATL and the NT 5.0 beta headers, you should not include the Internet Explorer 5.0 Beta headers and libraries nor the Windows NT 5.0 beta headers and libraries in your include or libpath.

For example, if you installed the SBN headers and libraries under root directory "C:\SBN" and you installed Visual C++ in the "C:\Program Files\Microsoft Visual Studio\VC98" directory, in Visual C++ your global directory options (Tools->Options->Directories tab) for your Include Files should resemble the following:

C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE
C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE
C:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE

This is different from any of the non-ATL samples in the Samples Gallery, all of which require the SBN path and the NT50 path to be added to the directory list.

© 1998 Microsoft Corporation. All rights reserved. Terms of use.

 

Magazine Home
Ask Jane
DHTML Dude
Extreme XML
For Starters
More or Hess
Servin' It Up
Site Lights
Web Men Talking
Member Community Home
Benefits: Freebies & Discounts
Benefits: Promote Your Site
Benefits: Connect with Your Peers
Benefits at a Glance
Online Special-Interest Groups
Your Membership
SBN Stores
Join Now
Workshop Home
Essentials
Content & Component Delivery
Component Development
Data Access & Databases
Design
DHTML, HTML & CSS
Extensible Markup Language (XML)
Languages & Development Tools
Messaging & Collaboration
Networking, Protocols & Data Formats
Reusing Browser Technology
Security & Cryptography
Server Technologies
Streaming & Interactive Media
Web Content Management
Workshop Index
Tools & Samples Home
Tools
Samples, Headers, Libs
Images
Sounds
Style Sheets
Web Fonts
Training Home
SBN Live Seminars
SBN Live Chats
Courses
Peer Support
CD-ROM Training
Books & Training Kits
Certification
SBN Home
New to SBN?
What's New on SBN
Site Map
Site Search
Glossary
Write Us
About This Site