US6401099
US6401099
BND
SAUS BINDSTATUSCALLBACK
- || -
CALLBACK PARSEDISPLAYNAME BENING
--O--H
48 ignone
US 6,401,099 B1
Page 2
U.S. PATENT DOCUMENTS Pike, Rob et al., “The Use of Name Spaces in Plan 9, ”
5,204,947 A 4/1993 Bernstein et al. Operating Systems Review, 27(2):72-76, Apr. 1993,
ISSN:O163-598O.
5,206.951 A 4/1993 Khoyi
5,237,680 A 8/1993 Adams et al. “NeXTSTEP General Reference, Vol. 1 .” NeXT Publica
5,249,275 A 9/1993 Srivastava tions, Addison-Wesley Publishing Co., 1992, pp. 1-3 to
5,274,803 A 12/1993 Dubin et al. 1-37, 2–5 to 2-16, 2-390 to 2-419, 2-503 to 2-507, 2-895
5,297.249 A 3/1994 Bernstein et al. to 2–896, 2-986 to 2-987, 2–1045 to 2-1046.
5,297.283 A 3/1994 Kelly, Jr. et al. Clapp, Doug, “The NeXT Application Kit, Part I: Non-Re
5,313,646 A 5/1994 Hendricks et al.
5,333,317 A 7/1994 Dann ......................... 707/100 sponsive Classes.” The NeXT Bible, Brady Books, N.Y.,
5,339.423 A 8/1994 Beitel et al. 1990, pp. 275-280.
5,339,424. A 8/1994 Fushimi Zdonik, Stanley B., “Object Management System Con
5,341,478 A 8/1994 Travis, Jr. et al. cepts,” Association for Computing Machinery, ACM #ACM
5,369,766 A 11/1994 Nakano et al. 0–89791-140–7/84/006/0013, 1984.
5,369,778 A 11/1994 San Soucie et al. Zdonik, Stanley Benjamin, Jr., “Object Management System
5,381547 A 1/1995 Flug et al. Concepts: Supporting Integrated Office WorkStation Appli
5,408,665 A 4/1995 Fitzgerald
5,410,688 A 4/1995 Willians et al. cation,” Doctoral Thesis Massachusetts Institute of Technol
5,440,744 A 8/1995 Jacobson et al. ogy, 1983.
5,446,842 A 8/1995 Schaeffer et al. Wolfgang, Herzner et al., “CDAM -Compound Doument
5,459,865 A 10/1995 Heninger et al. Access and Managment. An Object-Oriented Approach,”
5,481,722. A 1/1996 Skinner Multimedia, Systems, Interaction and Applications, Euro
5,517,655 A 5/1996 Collins et al. graphics Workshop, Apr. 1991, Stockholm, Sweden, pp.
5.535,389 A 7/1996 Elder et al. 17-36.
5,551,035 A 8/1996 Arnold et al.
5,572,643 A 11/1996 Judson Kobayashi, Masaaki et al., “An Update on BTRON-speci
5,577.252 A 11/1996 Nelson et al. .............. 395/670 fication OS Development," IEEE Proceedings of the 8th
5,581,686 A 12/1996 Koppolu et al. Tron Project Symposium, Cat. Nr. 91THO412-7, Nov. 1991,
5,634,121 A 5/1997 Tracz et al. Tokyo, Japan, pp. 132-140.
5,659,729 A 8/1997 Nielsen IBM, “Creating In-Line Objects Within an Integrated Edit
5,664,178 A 9/1997 Sinofsky ing Environment, IBM Technical Disclosure Bulletin,
5,706,501 A 1/1998 Horikiri et al. ............... 707/10
5,745,683 A 4/1998 Lee et al. ................ 395/2008 27(5):2962, Oct. 1984.
5,758,358. A 5/1998 Ebbo DiLascia, Paul et al., “Sweeper,” Microsoft Interactive
5,761,683 A 6/1998 Logan et al. DeveloperVol. 1, No. 1, Spring 1996, pp. 16-52.
5,764.984. A 6/1998 Loucks ....................... 395/682 Brown, Mark R., “Using Netscape 2, pp. 162-163,
5,778,372 A 7/1998 Cordell et al. 148-156, 718–719, 1993.
5,815,830 A 9/1998 Anthony
5,838,906 A 11/1998 Doyle et al. Mills Elinor, “Navigator Cookies Files Will Monitor Web
5,842,018 A 11/1998 Atkinson et al. User Activity,” Feb.2, 1996.
5,854,630 A 12/1998 Nielsen Berg, Al, “Cookies Nibble at Your Disk Drive,”0 Jul. 8,
5,963,964 A 10/1999 Nielsen 1996.
6,016,520 A 1/2000 Facq et al. Trupin, J., “The Visual Programmer Puts ActiveX Document
6,026,416 A 2/2000 Kanerva et al.
6,031,989 A 2/2000 Cordell Objects Through Their Paces.” Systems Journal, Jun. 1996.
OTHER PUBLICATIONS “Getting Results. With Microsoft Office for Windows 95,'pp.
109–112, Microsoft Corporation, 1996.
Peterson, Baird, “Unix Variants.” Unix Review U.S. Patent Application No. 08/761,709 filed December 6,
10(4):29-31, Apr. 1992. 1996, Koppolu et al.
U.S. Patent Jun. 4, 2002 Sheet 1 of 9 US 6,401,099 B1
09
'CIMVOGAEX) LO‘BN|IAOBIdC]
LE
(O "AVTdSIG)
U.S. Patent Jun. 4, 2002 Sheet 2 of 9 US 6,401,099 B1
FG 2
r
CCENT
Microsoft
.338 Eiga 1833.338E. is Stre
:: Silk:33:atisfig: S333,333.33.:li:).
fir, Liris
INSTANCE VIRTUAL
DATA FUNCTION
STRUCTURE TABLE METHOD O
90
92
METHOD 1
METHOD 2
88
U.S. Patent Jun. 4, 2002 Sheet 4 of 9 US 6,401,099 B1
FIG. 4
104 114
BNDCTX
BIND CONTEXT
MONKER
MONIKER
U.S. Patent Jun. 4, 2002 Sheet 5 of 9 US 6,401,099 B1
FIG. 5
CLENT
NAMED
OBJECT
MONIKER
MONIKER
U.S. Patent Jun. 4, 2002 Sheet 6 of 9 US 6,401,099 B1
FIG. 6
CLENT 158
BNDCTX
BIND CONTEX
. ASYNCHRONOUS
MONIKER
MONIKER
15O
BND
STATUS BNDSTATUSCALLBACK
CALLBACK PARSEDSPLAYNAME BNDING
BNDING
154
PERSISTMONIKER
NAMED OBJECT
17O
U.S. Patent Jun. 4, 2002 Sheet 7 of 9 US 6,401,099 B1
FIG. 7
CLIENT 204
BNDCTX
C
and context
REQUESTED
FORMATS URL MONIKER
MONIKER
ENUM
FORMATETC
162
TRANSPORT
BIND PROTOCOL
STATUS
CALLBACK
214
AUTHENTCATE
PROTOCOL
232 specific
HTTP- INTERFACES
NEGOTATE
208
PERSISTMONIKER
NAMED OBJECT
17O
U.S. Patent Jun. 4, 2002 Sheet 8 of 9 US 6,401,099 B1
STARTASYNCHRONOUS
FIG. 8A
250
GET BIND INFORMATION FROM BIND 252
CONTEXT
254 255
OBJECTS YES
RUNNING7
NO RETRIEVE OBJECT
Q/ FIG. 8B
260 Ny
CREATE URL OBJECT BASED ON 261 264
CLSD
CAL OBJECTS
QUERY FOR PERSIST INTERFACE PERSISTMONIKER::LOAD
OF OBJECT
END ASYNCHRONOUS
BINDING
US 6,401,099 B1
1 2
ASYNCHRONOUS BINDING OF NAMED moniker. The logic necessary to acceSS different data there
OBJECTS fore need not be hard coded into the client program. Instead,
the client need only include the code for interacting with
COPYRIGHT AUTHORIZATION monikers for the named objects. Further, each moniker
A portion of the disclosure of this patent document 5 exposes its binding function to clients through an interface.
contains material which is Subject to copyright protection. All monikerS Support a common interface Structure defined
The copyright owner has no objection to the facsimile by the monikers’ class. Since all monikerS Support the same
reproduction by anyone of the patent document or the patent interface, a client can interact with any moniker in the same
way using the same code. OLE monikers thus provide a
disclosure, as it appears in the Patent and Trademark Office general mechanism for a client program to access any
patent file or records, but otherwise reserves all copyright variety of data from any Source.
rights whatsoever. OLE monikers, however, have a drawback when used for
FIELD OF THE INVENTION retrieving data from a slow Source. The time to retrieve data
This invention relates generally to uniformly navigating from Some Sources (particularly from the Internet and other
15 remote Sources) is very slow relative to human response
or browsing data from a variety of Sources, and more time. (The Internet is a global network of cooperatively
particularly relates to methods and Systems for referencing interconnected computer networks, consisting of millions of
and retrieving data Stored in a computer. individual computers. A portion of the Internet referred to as
BACKGROUND AND SUMMARY OF THE the “world-wide web' consists of computers, also referred to
INVENTION as “sites,” which make multi-media documents in hyper-text
mark-up language (HTML) generally available for down
Previous techniques and mechanisms for navigating to loading or retrieval by individuals having a computer with
and retrieving data in a computer System have had signifi Internet access.) A typical personal computer user connects
cant drawbacks which pose obstacles to providing unified to the Internet with a 28.8 kbaud or slower modem device.
tools for browsing data Seamlessly and transparently from 25 The typical document accessed from the world wide web
all Sources (including local storage and remote networks). portion of the Internet, on the other hand, is Several tens of
Microsoft Corporation's Object Linking and Embedding kbytes in size, and often incorporates one or more pictures
(OLE) component Software technology provides a technique which also may be tens of kbytes in size. At the data transfer
for referencing and retrieving data in a computer System rate of the typical modem connection, Such typical data can
which uses Small objects referred to as monikers. An OLE take minutes to access from the Internet.
object is a Software component that may encapsulate both A drawback to using OLE monikers for retrieving data
code (i.e., functions or procedures comprising a sequence of from Such Sources is that OLE monikers block. More
program instructions) and data, and exposes its functionality Specifically, when a client calls a moniker's binding
(i.e., the code) to other programs and objects (referred to as function, the call does not return until the data retrieval
“clients”) through interfaces. An interface is a named set of 35 completes. During this time, execution of the client program
logically related functions. Each object is an instance of an (including its user interface) halts. In effect, the client's user
object type (referred to as a “class”) which defines the interface freezes and remains non-responsive to user input
Structure of interfaces that its objects Support. until the data access is complete. In the Microsoft Win
A moniker operates as a name for another object. It dowS(R) operating System, this condition of the client pro
encapsulates the name of the object together with functions 40 gram is indicated by changing the mouse cursor to an "hour
for retrieving the named object through a process referred to glass” icon when the client has the “focus” (i.e., the cursor
in OLE as “binding.” The binding process resolves or is positioned over the client’s window). Since the client is
dereferences a name of an object into a link or pointer to the blocked, it is unable to display a progress indicator (Such as
particular named object (which for OLE purposes is a a “% complete' bar graph or “estimated time remaining
pointer to an interface of the named object including loading 45 notification), or provide any control which the user can
the object from persistent storage, if needed). Thus, binding activate to cancel the data access. Since the client may
can be defined as a process of retrieving and linking to an remain non-responsive for a Substantial time while accessing
object referenced by a name. data with a moniker from a Slow Source, the user thus has no
The object named by a moniker can encapsulate any way of knowing whether the data is still being accessed or
desired data. The name, for example, can be a file name of 50 the client has “crashed' (i.e., become inoperative) due to
data Stored as a file on a computer's hard drive or on a shared Some error. As a result, OLE monikers provide a low quality
network drive. The name can even be a uniform resource of Service when used for retrieving data from Slow Sources.
locator (URL) identifying a document or other data residing A unified browsing environment is provided in the present
on the Internet. Further, the binding function in the moniker invention by an object-oriented framework and System hav
contains the code to perform all the Steps necessary to bind 55 ing objects, programming interfaces, object integration
to the data, including finding the code associated with the interfaces, and methods for Supporting unified retrieval of
particular data referenced by the name, instantiating an data from different Sources. The invention overcomes the
object to encapsulate the data with its associated code, and limitation in previous monikers of blocking execution of the
loading the data from its Storage Source into the object. Thus, moniker's client, and thus provides Source-transparent and
a client program can acceSS any data from any Source using 60 responsive browsing.
a moniker that names that data, including a document Stored According to one aspect of the invention, a computer
as a file on a computers hard drive, a particular piece of a programming platform includes monikers (referred to herein
document (Such as a particular cell of a spreadsheet), or even as "asynchronous monikers’) which access data asynchro
data from remote Sources Such as the Internet or on-line nously. When a client calls the binding method of an
Services. 65 asynchronous moniker, the asynchronous moniker returns
OLE monikers have the advantage that the code for control immediately to the client and completes the data
retrieving data resides outside the client program in the access as a separately executing task or thread (Sometimes
US 6,401,099 B1
3 4
referred to as “background processing”). Alternatively, the 3. OLE Server and Document Object Overview
moniker retrieves data to Storage with an asynchronous 4. Moniker Overview
Storage object which allows asynchronous acceSS by the 5. Asynchronous Monikers
client to the data as it is retrieved to Storage. Thus, even 5.1 Asynchronous and Synchronous Binding Selection
where the data is remotely accessed from a Slow Source, the 5 5.2 Asynchronous and Synchronous Storage
client is able to maintain a responsive user interface, which 5.3 Data-pull and Data-push models
prevents the perception of poor and non-uniform perfor 5.4 The IBinding Interface
CC.
5.4.1 The IBinding: Abort Function
In the illustrated embodiment, the asynchronous moniker 5.4.2 The IBinding::Suspend Function
and the client provide interfaces through which they interact 5.4.3 The IBinding::Resume Function
while the data acceSS is performed. Through the client's 5.4.4 The IBinding::SetPriority Function
interface, the asynchronous moniker provides notifications 5.4.5 The IBinding::GetPriority Function
of the status of the data access to the client. The client thus 5.5 The IBindStatusCallback Interface
is able to display a progreSS indicator. Also, the client can 5.5.1. The BIND VERB Enumeration
call functions through the interface of the asynchronous 15 5.5.2 The BINDINFOF Enumeration
moniker to abort, Suspend, or resume the data access. 5.5.3 The BINDINFO Structure
The illustrated embodiment of the invention provides an 5.5.4 The BSCO OPTION Enumeration
asynchronous moniker (referred to herein as a “URL 5.5.5 The BINDF Enumeration
moniker”) which references data with an Internet URL, and 5.5.6 The BSCF Enumeration
provides asynchronous access to the data for the client. The 5.5.7 The BINDSTATUS Enumeration
URL moniker has the capability of parsing the URL it 5.5.8. The IBindStatusCallback: QueryInterface Func
contains, and utilizing an associated Internet transport pro tion
tocol to access the data it names from the Internet. The 5.5.9 The IBindStatusCallback::GetBindInfo Function
programming platform includes an application program 25 5.5.10 The IBindStatusCallback: OnStartBind ing
ming interface which utilizes this parsing capability to Function
provide an extensible Service for creating a moniker which 5.5.11 The IBindStatusCallback::GetPriority Function
uses an appropriate transport protocol for a given data 5.5.12 The IBindStatusCallback::OnProgress Function
reference. The programming platform also provides object 5.5.13 The IBindStatusCallback::OnDataAvailable
integration interfaces for the moniker's client to negotiate Function
acceptable media types with the data Source. 5.5.14 The IBindStatusCallback:OnObject Available
Additional features and advantages of the invention will Function
be made apparent from the following detailed description of 5.5.15 The IBindStatus Callback:: On LowReso urce
an illustrated embodiment which proceeds with reference to Function
the accompanying drawings. 35 5.5.16 The IBindStatusCallback: OnStopBind ing
Function
BRIEF DESCRIPTION OF THE DRAWINGS 5.6 The IPersistMoniker Interface
FIG. 1 is a block diagram of a computer System that may 5.6.1 The IPersistMoniker::IslDirty Function
be used to implement a method and apparatus embodying 5.6.2 The IPersistMoniker::Load Function
the invention for unified browsing. 40 5.6.3 The IPersistMoniker::Save Function
FIG. 2 is a diagram illustrating a browsing System includ 5.6.4 The IPersistMoniker:SaveCompleted
ing the computer of FIG. 1 for unified browsing according 5.6.5 The IPersistMoniker::GetCurMoniker Function
to an illustrated embodiment of the invention. 5.7 API Functions for Asynchronous Monikers
FIG. 3 is a block diagram of typical data Structures for an 5.7.1. The Create AsynchbindCtX API Function
object in the computer system of FIG. 1. 45 5.7.2 The RegisterBindStatusCallback API Function
5.7.3 The RevokeBindStatusCallback API Function
FIG. 4 is a block diagram of software components that 5.7.4 The ISAsyncMoniker API Function
Support binding to a named object using a moniker. 6. URL Monikers
FIG. 5 is a process flow diagram of a binding process 6.1 Media-type Negotiation with the URL Moniker
performed by the moniker of FIG. 4. 50 6.1.1 The RegisterMediaTypes API Function
FIG. 6 is a block diagram of Software components includ 6.1.2 The CreateEormat numerator API Function
ing an asynchronous moniker for unified browsing to data in 6.1.3 The RegisterFormat numerator API Function
the computer of FIG. 1 according to one illustrated embodi 6.1.4 The RevokeFormat numerator API Function
ment of the invention. 6.1.5 The CreateURLMoniker API Function
FIG. 7 is a block diagram of software components includ 55 6.2 URL Moniker Functions
ing a URL moniker for unified browsing in the computer of 6.2.1 The URL Moniker-IUnknown::QueryInterface
FIG. 1 of documents referenced by a URL from the Internet Function
according to another illustrated embodiment of the inven 6.2.2 The URL Moniker-IPersist::Get ClassID Function
tion. 6.2.3 The URL Moniker-IPersistStream::IslDirty Func
FIGS. 8A-8B are flow charts illustrating an asynchronous 60 tion
binding process performed in the asynchronous moniker of 6.2.4 The URL Moniker-IPersistStream::Load Func
FIG. 6 and URL moniker of FIG. 7. tion
6.2.5 The URL Moniker-IPersistStream::Save Function
DETAILED DESCRIPTION OF THE
6.2.6 The URL Moniker-IPersistStream::GetSize Max
ILLUSTRATED EMBODIMENTS
65 Function
1. Browser Overview 6.2.7 The URL Moniker-IMoniker:BindToobject
2. Object Overview Function
US 6,401,099 B1
S 6
6.2.8 The URL Moniker-IMoniker:BindToStorage AS is familiar to those skilled in the art, the computer
Function System 20 further includes an operating System and at least
6.2.9 The URL Moniker-Moniker::Reduce Function one application program. The operating System is the Set of
6.2.10 The URL Moniker-IMoniker: ComposeWith Software which controls the computer System's operation
Function and the allocation of resources. The application program is
6.2.11 The URL Moniker-Moniker::Enum Function the Set of Software that performs a task desired by the user,
6.2.12 The URL Moniker-IMoniker::IsBqual Function using computer resources made available through the oper
6.2.13 The URL Moniker-IMoniker::Hash Function ating System. Both are resident in the illustrated memory
6.2.14 The URL Moniker-IMoniker::IsRunning Func system 26.
tion
6.2.15 The URL Moniker-IMoniker::GetTimeOfLas In accordance with the practices of perSons skilled in the
tChance Function art of computer programming, the present invention is
6.2.16 The URL Moniker-IMoniker::Inverse Function described below with reference to acts and symbolic repre
6.2.17 The URL Moniker-IMoniker::Common Prefix Sentations of operations that are performed by computer
With Function System 20, unless indicated otherwise. Such acts and opera
6.2.18 The URL Moniker-IMoniker::RelativePathT o 15 tions are Sometimes referred to as being computer-executed.
Function It will be appreciated that the acts and Symbolically repre
6.2.19 The URL Moniker-IMoniker::Get DisplayName sented operations include the manipulation by the CPU 24 of
Function electrical Signals representing data bits which causes a
6.2.20 The URL Moniker-IMoniker::ParselDisplay resulting transformation or reduction of the electrical Signal
Name Function representation, and the maintenance of data bits at memory
6.2.21 The URL Moniker-IMoniker::IsSystemMoniker locations in memory System 26 to thereby reconfigure or
Function otherwise alter the computer System's operation, as well as
6.3 Client Extension Services other processing of Signals. The memory locations where
6.4 The IAuthenticate interface data bits are maintained are physical locations that have
6.5 The IHttpNegotiate Interface 25 particular electrical, magnetic, or optical properties corre
6.5.1 The IHttpNegotiate::BeginningTransa ction sponding to the data bits.
Function 1. Browser Overview
6.5.2 The IHttpNegotiate::OnHeaders Available Func In a browsing environment 50 of an illustrated embodi
tion ment of the invention shown in FIG. 2, the computer 20 (also
6.5.3 The IHttpNegotiate:OnError Function shown in FIG. 1) runs software, referred to herein as a
1. Computer Overview “browser,” for unified browsing of electronic documents and
Referring to FIG. 1, an operating environment for an other data from local Sources (e.g., the Secondary storage 42
illustrated embodiment of the present invention is a com of FIG. 1) and from a remote computer network 52. The
puter System 20 with a computer 22 that comprises at least browser can be integrated with the operating System
one high speed processing unit (CPU) 24, in conjunction 35 Software, or can be a separate application Software. The
with a memory System 26, an input device 28, and an output illustrated browser is implemented by the Software as an
device 30. These elements are interconnected by at least one OLE object (described below).
bus structure 32. The illustrated remote computer network 52 is the
The illustrated CPU24 is of familiar design and includes Internet, which is described in the Background and Sum
an ALU 34 for performing computations, a collection of 40 mary of the Invention above. In the illustrated browsing
registers 36 for temporary Storage of data and instructions, environment 50, the computer 20 connects to the computer
and a control unit 38 for controlling operation of the system network 52 over a telephone line 54 with a modem 56. Other
20. The CPU 24 may be a processor having any of a variety physical connections to the computer network alternatively
of architectures including Alpha from Digital, MIPS from can be used, such as an ISDN, T1 or like high speed
MIPS Technology, NEC, IDT, Siemens, and others, x86 45 telephone line and modem, a television cable and modem, a
from Intel and others, including Cyrix, AMD, and Nexgen, Satellite link, an optical fiber link, an Ethernet or other local
and the PowerPC from IBM and Motorola. area network technology wire and adapter card, radio or
The memory System 26 generally includes high-Speed optical transmission devices, etc. The invention can alter
main memory 40 in the form of a medium such as random natively be embodied in a browsing environment for other
access memory (RAM) and read only memory (ROM) 50 public or private computer networks, Such as a computer
Semiconductor devices, and Secondary Storage 42 in the network of a commercial on-line Service or an internal
form of long term Storage mediums. Such as floppy disks, corporate local area network (LAN), an intranet, or like
hard disks, tape, CD-ROM, flash memory, etc. and other computer network.
devices that Store data using electrical, magnetic, optical or Documents for browsing with the illustrated browser can
other recording media. The main memory 40 also can 55 reside as files of a file System Stored in the computer's
include Video display memory for displaying images Secondary storage 42 (FIG. 1), or reside as resources at a
through a display device. Those skilled in the art will remote computer 58 (also referred to as a “site') connected
recognize that the memory 26 can comprise a variety of to the computer network 52, such as a world-wide web site
alternative components having a variety of Storage capaci on the Internet. The illustrated document 60 residing at the
ties. 60 site 58 conforms with HTML standards, and may include
The input and output devices 28, 30 also are familiar. The extensions and enhancements of HTML standards.
input device 28 can comprise a keyboard, a mouse, a However, the illustrated browser also can browse documents
physical transducer (e.g., a microphone), etc. The output having other data formats (e.g., Microsoft(R) Word
device 30 can comprise a display, a printer, a transducer documents, etc.) from the computer 20 or remote computer
(e.g., a speaker), etc. Some devices, Such as a network 65 58.
interface or a modem, can be used as input and/or output In conformance with HTML, the illustrated document 60
devices. can incorporate other additional information content 62,
US 6,401,099 B1
7 8
Such as images, audio, Video, executable programs, etc. asSociated terminology is provided below before discussing
(hereafter simply “images”. 62), which also reside at the the details of the illustrated embodiment.
remote computer 58. The document 60 and images 62 An object is an instance of a programmer-defined type
preferably are Stored as files in a file System of the remote referred to as a class, which exhibits the characteristics of
computer 58. The document 60 incorporates the images 62 data encapsulation, polymorphism and inheritance. Data
using HTML tags that specify the location of files or other encapsulation refers to the combining of data (also referred
Internet resource containing the images on the Internet 52. to as properties of an object) with methods that operate on
When used for browsing documents, the illustrated the data (also referred to as member functions of an object)
browser displays the document in a window 68 or rectan into a unitary Software component (i.e., the object), Such that
gular area of the computer's display 30 allocated to the the object hides its internal composition, Structure and
browser by the operating system. The illustrated window 68 operation and exposes its functionality to client programs
comprises a frame 70, a document display area 72, and user that utilize the object only through one or more interfaces.
An interface of the object is a group of Semantically related
interface controls 74. The browser provides the document member functions of the object. In other words, the client
display area 72 for displaying the document. programs do not access the object's data directly, but must
The browser and other client applications within the 15
instead call functions on the object's interfaces to operate on
computer 20 preferably work with documents (which have the data.
data formats other than those native to the browser or client Polymorphism refers to the ability to view (i.e., interact
application) by encapsulating the document's data into an with) two similar objects through a common interface,
asSociated object, and integrating with the object using thereby eliminating the need to differentiate between two
pre-defined interfaces as described more fully below. These objects. Inheritance refers to the derivation of different
document objects include the code to work with the docu classes of objects from a base class, where the derived
ment's data, including code to display the document data in classes inherit the properties and characteristics of the base
the document display area 72. The browser thus operates as class (which for purposes of OLE are the interfaces of the
a host or container of document objects, by providing a base class).
window and frame which includes a document display area 25 OLE'S COM specification defines binary standards for
in which a hosted document object can display its document. objects and their interfaces which facilitate the integration of
Working with documents encapsulated as document objects Software components. According to the COM Specification,
allows full use of all the features described below. a typical object 80 is represented in the computer system 20
Alternatively, the browser or other client application can (FIG. 1) by an instance data structure 82, a virtual function
work with a document by launching an application program table 84, and member functions 86-88. The instance data
asSociated with the document, and causing the associated structure 82 contains a pointer 90 to the virtual function table
application program to load the document and perform a 84 and data 92 (also referred to as data members, or
Specified operation on the document. In the MicroSoft Win properties of the object). A pointer is a data value that holds
dowS(R) operating System, this is done by looking up the the address of an item in memory. The virtual function table
application program associated with the document's file 35 84 contains entries 96-98 for the member functions 86–88.
name extension in the System registry, (e.g., *.doc' for Each of the entries 96-98 contains a reference to the code
Microsoft(R) Word documents, “.Vsd” for Shapeware's 86-88 that implements the corresponding member function.
VISIO drawings, etc.) and a text String command for direct The pointer 90, the virtual function table 84, and the
ing the program to perform a desired operation. The appli member functions 86-88 implement an interface of the
cation program associated with a document also may be 40 object 80. Client programs interact with the object 80 by
identified in the Microsoft Windows(R operating system by obtaining a pointer (referred to as an interface pointer) to the
matching a bit pattern at Specific offset into the file as also pointer 90 of the virtual function table 84. OLE includes a
Specified in the System registry. The browser or other client type definition of an interface pointer which allows client
application patches the document's file name into the text programs to call member functions on the interface by name
String command, and invokes the operating System's shell 45 through the interface pointer and provides type checking on
execute Service to execute the command. Shell execute is a the functions arguments, as expressed in the following code
well known Windows(R operating system service which (in the C++ programming language):
issues a text String as a command to the operating System's pinterface->MemberFunction(...)
command interpreter (i.e., the “command.com” program in By convention, the interfaces of an object are illustrated
the WindowS(E) operating System). The text string generally 50 graphically as a plug-in jack as shown for the document
is in the form of an MS-DOS command, which specifies a object in FIG. 3. Also, Interfaces conventionally are given
path and file name of the associated application program's names beginning with a capital “I.” Objects can include
executable file, a flag for Specifying the desired operation, multiple interfaces which are implemented with one or more
and the document's path and file name. The command virtual function tables. The member function of an interface
interpreter responds by parsing the text String, loading the 55 is denoted as “InterfaceName::FunctionName.”
application program Specified in the text String, and passing The object 80 conforming to the COM specification
the flag and the document's path and file name as command exhibits data encapsulation by exposing its interfaces
line arguments into the application program. The application (Semantic groupings of its member functions) to client
program then “opens’ (i.e., loads) the document and per programs. The client programs interact with the object 80 by
forms the operation specified by the flag. 60 calling the member functions 86-88 on a particular interface
2. Object Overview of the object, but do not directly manipulate the object's
Referring to FIG. 2, the illustrated embodiment of the data. The object 80 also exhibits polymorphism and inher
invention utilizes objects which conform to the component itance in that the object 80 can provide interfaces in common
object model (COM) of Microsoft Corporation's OLE. For with a base class and other similar objects, So that client
a detailed discussion of OLE see Inside OLE, Second 65 programs can interact with each of the objects in the same
Edition by Kraig BrockSchmidt, Microsoft Press, Redmond, manner by calling member functions of the interface that the
Wash. 1995. A brief overview of objects in OLE and objects have in common.
US 6,401,099 B1
10
3. OLE Server and Document Object Overview member function named “QueryInterface.” The QueryInter
Referring now to FIG. 5, the virtual function table 84 and face function can be called with an interface identifier as an
member functions 86–88 of the OLE object 80 are provided argument, and returns a pointer to the interface associated
by a server application program 100 which is stored in the with that interface identifier. By convention, the IUnknown
computer System 20 (FIG. 1) as an executable program file interface's member functions are included as part of each
(with a "...exe' file name extension) or as a dynamic link interface on an object. Thus, any interface pointer that the
library file (with a “.dll” file name extension). Dynamic link client obtains to an interface of the object 80 can be used to
library files are loaded, dynamically linked, and executed by
the WindowS(R) operating System in a Same process with a call the QueryInterface function.
client application program. Executable program files are
loaded by the operating System as a separately executing In a typical Situation, however, the only information that
process. In accordance with OLE, the server application 100 the client program 104 has to reference a particular docu
includes code for the virtual function table 84 (FIG. 3) and ment is a textual name, Such as a file name or an Internet
member functions 86-88 (FIG. 3) of the classes that it URL. In the case of a file name, the COM library provides
Supports, and also includes a class factory that generates the 15 API functions (e.g., “GetClassFile,” “ReadClassStg” and
instance data structure 82 (FIG. 3) for an object of the class. “ReadClassStm”) for obtaining a CLSID associated with the
A Server application can be written by a programmer to file. These functions, however, are Specific to document data
Support a particular class of object that contains any desired that is Stored as a file in a computer's local Storage.
data. For example, a programmer can write Server applica
tions which provide objects that contain the data of a 4. Moniker Overview
particular variety of computer document (e.g., document 60
of FIG. 2), Such as a text document, spreadsheet, drawing, With reference to FIGS. 4 and 5, the client program 104
etc., or that contain data for part of a computer document, also can gain access (i.e., a pointer to an interface) to the
Such as a range of spreadsheet cells, a paragraph of a text object 80 which encapsulates some desired data based on a
document, etc. These objects which contain document data 25 name that references the object using a moniker 120. The
are referred to herein as document objects. For example, moniker 120 generally is provided by the COM library of the
Software application programs Such as MicroSoft(E) Word can operating System 114. Alternatively, the moniker may be
be written as a Server application in which the application provided by the Server application associated with the object
program's documents are represented as OLE objects. A 80. The system 114 includes API functions which the client
Server application also can be written for representing the program 104 calls to have a moniker created for a given
HTML document 60 and images 62 (FIG.2) as OLE objects. name. In OLE, there are four Standard classes of monikers,
This allows other client programs 104 (such as the unified i.e., file moniker, item moniker, pointer moniker, and anti
browsing Software program illustrated in FIG. 2) and objects moniker, which are described more fully in the book, Inside
to interact with the document through interfaces of the OLE, Second edition, Supra. The API functions for creating
document object. 35
a moniker of these Standard moniker classes are Summarized
For the client program 104 to interact with the document in the following table:
object 80 provided by the server application 100, the server
application must first create the object (i.e., instantiate an TABLE 1.
object of a class Supported by the Server application) and the
client 104 must gain an interface pointer to the object 80. In 40 OLE Moniker APIs
OLE, the client program 104 realizes these events using
services provided by OLE and a set of standard object Function Description
interfaces defined by COM based on class and interface CreateFile Moniker(pszPath, Creates a file moniker, given any
identifiers assigned to the object's class and interfaces. More ppmk) portion of a path name in pszFile. The
Specifically, the Services are available to client programs as 45 portion can be as short as a drive letter
or as long as a complete path. The file
application programming interface (API) functions provided moniker converts pszPath to a standard
in the COM library, which is part of a component of the UNC path. Anything the operating
Windows(R operating system in a file named “OLE32.DLL.” system understands as a path is
In OLE, classes of objects are uniquely associated with class suitable for a file moniker.
CreateItemMoniker(pszDeli Creates an item moniker for which
identifiers (“CLSIDs"). Class identifiers are 128-bit globally 50
m, pSZItem, ppmk) pSZItem identifies the item's name and
unique identifiers (“GUID”) that the programmer creates pSZDelim identifies a delimiter string
with an OLE service named “CoCreateCUID' and assigns (usually a single character such as ),
to the respective classes. The interfaces of an object are which does not occur elsewhere in
associated with interface identifiers (“IIDs"). pszItem. This delimiter is used to prefix
the item's display name, allowing it to
In particular, the COM library provides an API function, 55 be combined with other items in the
“CoCreateInstance,” that the client program 104 can call to same string and parsed out of that
request creation of an object to encapsulate a particular string again.
CreatePointerMoniker(pIUnk Creates a pointer moniker to
documents data using a CLSID associated with the data. The nown, ppmk) encapsulate the pointer passed in
CoCreateInstance API function creates the object and pIUnknown. This makes any object
returns a pointer of the requested interface to the client 60 look like a moniker.
program. Create AntiMoniker(ppmk) Creates an anti-moniker, which needs
no extra information.
Once the client program 104 has obtained a first interface
pointer to the object 80, the client obtains pointers to other
desired interfaces of the object using the interface identifier
associated with the desired interface. COM defines several 65 For creating a moniker based on a user-provided name,
Standard interfaces generally Supported by OLE objects the system 114 also provides an OLE API function called
including the IUnknown interface. This interface includes a MkParsedisplayName, which has the following form:
US 6,401,099 B1
11 12
read and write their State persistently as a data Stream or file
in the computer's Secondary storage 42 (FIG. 1). This means
that the moniker 120 also includes member functions to
HRESULT MkParseDisplayName(IBindCtx *pbc, LPCWSTR pszName,
ULONG *pchEaten, IMoniker **ppmk) support the IPersistStream interface, which allows the client
to store and load the moniker 120 from the secondary
Storage.
The MkParselDisplayName API function parses a text The member functions which the moniker 120 exposes
String (the parameter “pSZName”) into a moniker. The text through the IMoniker interface 124 include two functions,
String can have one of two initial patterns: a uniform naming BindToCbject and BindToStorage (herein collectively
convention (UNC) path name (a conventional file system referred to as BindToxxx), which the client 104 calls to bind
path name such as “c:\directory\file”), or the character “G” to the named object 80. The BindToCbject function per
followed by a program identifier (ProgID) of a server forms binding by instantiating the named object 80 in the
application. In the case of a UNC path name, the API memory 40 (FIG. 1) of the computer, and returns an inter
function creates a file moniker and calls the file moniker's face pointer of the named object 80 to the client 104. The
“ParselDisplayName” function (described below) to parse 15 BindToStorage function performs binding by instantiating
the text string. In the case of a text string with the “G” the named object 80 onto an OLE storage stream which is
character and ProgID, the API function creates an object Stored in the computer's Secondary Storage 42 (e.g., on the
based on a CLSID associated with the ProgID in the hard drive), rather than into the main memory 40. In the
operating System's registry database and calls a “ParSeDis browsing environment 50 illustrated in FIG. 2 for example,
playName” member function on an “IParselDisplayName” the BindToStorage function is used to download a file such
interface of that object, which is defined as follows: as an image or Video clip directly onto hard disk Storage,
whereas the BindToCbject function is used to create an
instance of an object for an HTML document with code for
interface IParselDisplayName : IUnknown { Viewing the document.
HRESULT ParseDisplayName(IBindContext *pbc, 25 The IMoniker interface 124 also exposes the functions,
LPOLESTR pszDisplayName, ULONG Get DisplayName and ParselDisplayName, of the moniker
*pchEaten, IMoniker **ppmkOut); 120 to the client 104. The Get DisplayName function returns
a human-readable display name of the object 80 which the
client can display to the user, Such as in a list box control or
By effectively plugging in a new name-to-moniker parser in other user interface element. The display name is a text
this way, the MkParselDisplayName API can be extended to String that names the object 80, Such as a path and file name
create new classes of monikers. or an Internet URL. The ParselDisplayName function oper
The moniker 120 exposes a set of member functions to the ates in reverse, creating a moniker based on a text String
client 104 through an interface 124, designated IMoniker, provided by the client.
which is defined as follows: 35 Further details of the moniker's member functions are
described in Inside OLE, Second edition, Supra.
When calling most of the moniker's member functions,
interface IMoniker : public IPersistStream {
the client program 104 passes a pointer to a bind context 126
public: as a parameter of the call. The bind context 126 is an object
HRESULT BindToobject(IBindCtx *pbc, IMoniker *pmkToLeft, 40 which operates as a central repository of information used
REFIID ridResult, void *ppvResult); globally in the binding process, Such as a table of running
HRESULT BindToStorage(IBindCtx *pbc, IMoniker objects. The bind context 126 has an interface 128, desig
*pmkToLeft, REFIID rid, void **ppvObi); nated IBindCtX, which is defined as follows:
HRESULT Reduce(IBindCtx *pbc, DWORD
dwReduceHowFar, IMoniker **ppmkToLeft, IMoniker
**ppmkReduced); 45
RESULT ComposeWith(IMoniker *pmkRight, BOOL
fCnlyIfNotGeneric, IMoniker **ppmkcomposite); interface IBindCtx: IUnknown
RESULT Enum(BOOL fForward, IEnumMoniker {
**ppenumMoniker); HRESULT RegisterObjectBound (IUnknown *pUnk);
RESULT IsEqual(IMoniker *pmkOtherMoniker); HRESULT RevokeobjectBound(IUnknown punk);
RESULT Hash(DWORD *pdwHash); 50 HRESULT ReleaseBoundObjects(void);
RESULT IsRunning(IBindCtx *pbc, IMoniker *pmkToLeft, HRESULT SetBindOptions(BIND OPTS *pbindopts):
IMoniker *pmkNewlyRunning); HRESULT GetBindOptions(BIND OPTS *pbindopts):
RESULT GetTimeOf LastChange(IBindCtx *pbc, IMoniker HRESULT GetRunningObjectTable(IRunningObjectTable
*pmkToLeft, FILETIME *pFileTime); **ppROT):
RESULT Inverse(IMoniker **pmk); HRESULT RegisterObjectParam(LPOLESTR pszKey,
RESULT Common PrefixWith(IMoniker *pmkOther, IMoniker 55 IUnknown punk);
**ppmkPrefix); HRESULT GetObjectParam(LPOLESTR pszKey, IUnknown
RESULT RelativePathTo(IMoniker *pmkOther, IMoniker **ppUnk);
**ppmkRelPath); HRESULT EnumObectParam(IEnumString **ppEnum);
RESULT GetDisplayName(IBindCtx *pbc, IMoniker HRESULT RevokeobjectParam(LPOLESTR pszKey);
*pmkToLeft, LPOLESTR *ppszDisplayName);
RESULT ParseDisplayName(IBindCtx *pbc, IMoniker
*pmkToLeft, LPOLESTR *pszDisplayName, ULONG 60
*pchEaten, IMoniker **ppmkOut); The bind context 126 is provided by the system 114. The
HRESULT IssystemMoniker(DWORD *pdwMksys); client program 104 creates the bind context 126 by calling
a system API function, Create BindCtX. The client program
104 creates the bind context once, then passes a pointer to
AS indicated in the above interface definition, the IMon 65 the bind contexts IBindCtX interface in calls to the moniker
iker interface is derived from the IPersistStream interface, 120. This allows the moniker 120 to retrieve global infor
which is a well known OLE interface for objects that can mation stored in the bind context 126 by calling functions on
US 6,401,099 B1
13 14
the IBindCtX interface. When called by the client to bind to 5. Asynchronous Monikers
the named object 80 for example, the moniker 120 can look In an illustrated embodiment of the invention shown in
in the running objects table of the bind context 126 to FIG. 6, a client program (hereafter "client”) 152 uses an
determine whether the object already exists. If the object asynchronous moniker 150 to asynchronously bind to a
exists, the moniker 120 can Simply return an interface named object 154. The asynchronous moniker 150 is an
pointer of the existing object to the client 104, and thus avoid instance of an asynchronous moniker class which is derived
creating the object again. Other uses of the bind context are from the moniker class and Supports the IMoniker interface
described in Inside OLE, Second edition, Supra. 124. Asynchronous binding effectively retrieves data from
FIG. 5 illustrates the operation of the moniker 120 per its Source as a background process which allows the client
forming the binding proceSS for the client program 104 to an 152 to continue execution. Since the client 152 is not
interface of the named object 80. In the illustrated example, blocked, the client's user interface remains responsive dur
the client program 104 uses the moniker 120 to bind to the ing the binding process. This is particularly useful for
object referenced by a name with code Such as the following: loading objects having data from slow Sources, Such as the
Internet and other remote networks with high latency and
15 slow data transfer connections. The client 152 thus is able to
HRESULT hir: more uniformly browse data from fast and Slow Sources
IBindCtx* pbc;
hr=CreatBindCtx(0,&pbc);
while maintaining the user perception of equivalent respon
Siveness and quality of Service.
IMoniker *pmk; Similar to the use of standard OLE monikers described
IObj1 *pObj: above, the client 152 creates an asynchronous bind context
GetMonikerSomehow(&pmk); 156, and the asynchronous moniker 150 by calling API
hr = pmk->BindToCbject(pbc.O.IID IObj1, &pObi);
if (hr==S OK): functions (specifically, the Create AsynclindCtX API func
pObj->SomeFunction.(...); tion and the MkParselDisplayNameEX API functions both
described below) provided by an operating System compo
25 nent 158 (specifically a component such as the COM library
In this example, the named object 80 exposes a member 114 of FIG. 4, which additionally implements the asynchro
function, SomeFunction, through an IObj1 interface 130, nous moniker API functions described below). The asyn
and includes a second interface 131, IObj2. With the above chronous bind context Supports IBindCtX interface 128 of
code, the client first creates the bind context 126 which will the bind context 126 (FIG. 4). The client 152 then calls the
be used later by the moniker 120 when binding to the named BindToCbject or BindToStorage function on the IMoniker
object 80. The client creates the bind context by calling the interface 124 of the asynchronous moniker 150 to initiate the
Create BindCtX API function of the system 114 as described asynchronous binding process.
above. The CreateBindCtX API function returns an interface The asynchronous binding process involves additional
pointer of the IBindCtX interface 128 to the client 104, communication or “handshaking” between the client 152
which the client stores as the pointer variable 134, pbc. 35 and asynchronous moniker 150 not performed in the syn
The client next creates the moniker 120 which names the chronous binding process by Standard OLE monikers (e.g.,
object 80 using a moniker creation API function of the the moniker 120). In the asynchronous binding process, the
System 114 as described above (e.g., asynchronous moniker 150 returns control immediately to
MKParselDisplayName). The client is returned an interface the client 152 from the client's call (e.g., call 140 of FIG. 5)
pointer of the IMoniker interface 124. In this example code, 40 to one of the asynchronous moniker's binding functions
the client stores this pointer to the IMoniker interface 124 of (e.g., BindToCbject and BindToStorage). After the call
the moniker 120 as a pointer variable 136, pmk. The client returns, instantiation of the named object 154 and loading of
104 then performs a call 140 to the BindToCbject function the object's data proceeds. Meanwhile, the client and asyn
on the IMoniker interface 124 of the moniker 120 to bind to chronous binding proceSS continue communicating So that
the named object 80. In the call 140, the client passes an 45 the client remains informed of the progreSS of loading the
interface identifier (IID IObj1) to request binding to a data and can interrupt or terminate loading of the data.
particular interface (the IObj1 interface 130) of the named This handshaking between the client 152 and the asyn
object 80. chronous binding proceSS is effected using two additional
In the moniker's BindToCbject function, the moniker 120 interfaces, an IBinding interface 160 and an IBindStatus
includes code which launches the object's Server application 50 Callback interface 162. In the illustrated embodiment of the
program 100, requests creation of the named object, and invention, the IBinding interface 160 is an interface of a
queries for a pointer to the interface requested by the client. binding object 164 which is provided by the asynchronous
The moniker 120 typically performs these steps with calls moniker 150. The client 152 implements a bind-status
142 to the GetClassFile and CoCreateInstance API functions callback object 166 which supports the IBindStatusCallback
described above, and to the QueryInterface member function 55 interface 162.
of the object 80 to query for the requested interface of the Prior to initiating the asynchronous binding process with
object as also described above. As a result, the object 80 is a call to the IMoniker interface 124 of the asynchronous
instantiated by its class factory in the server application 100, moniker 150, the client 152 registers its bind-status-callback
and returns (144) a pointer of the requested interface (the object 166 with the asynchronous bind context via the
IObj1 interface 130 in this example) of the named object 80 60 RegisterBindStatusCallback API function described more
to the moniker 120. The moniker 120, in turn, returns (146) fully below. When the client thereafter calls the IMon
the object's interface pointer to the client program 104. iker::BindToCbject or IMoniker::BindToStorage function as
Whereupon, the client program can directly call (148) mem shown in FIG. 5 and described above, the client 152 passes
ber functions on the interface of the named object 80. At this an interface pointer of the bind context's IBindCtX interface
point, the binding process is complete and the moniker 120 65 128 to the asynchronous moniker 150. In the IMon
is no longer needed by the client program 104 to access the iker::BindToxXx function, the asynchronous moniker 150
named object 80. looks up the client's bind-status-callback object 164, creates
US 6,401,099 B1
15 16
the binding object 164, and hooks together the binding asynchronous moniker's IMoniker::BindToStorage
object 164 and the client's bind-status-callback object 166 function, and receiving asynchronous notifications. In the
by passing an interface pointer of the IBinding interface 160 data-pull model, the client 152 drives the bind operation.
to the bind-status-callback object 166 (with a call to the The asynchronous moniker 150 only provides data to the
bind-status-callback objects IBindStatusCallback: OnStart client 152 when the client reads the data. Specifically, this
Binding function described more fully below). The asyn means that beyond the asynchronous moniker's first call to
chronous moniker 150 then returns control to the client 152 the IBindStatus Callback:: On DataAvailable function
from the IMoniker::BindToxXX function, and allows the (described below), the asynchronous moniker 150 will not
binding object 164 to proceed with the binding process with provide any data to the client unless the client has consumed
the binding object 164 and bind-status-callback object 166 all of the data that is already available. Because the asyn
communicating directly. chronous moniker 150 only downloads data as it is
5.1 Asynchronous and Synchronous Binding Selection requested, the client nevertheless should read the data in a
In the illustrated embodiment, the client 152 can deter timely manner. In the case of downloading data from Inter
mine whether any particular moniker Supports asynchronous net for example, the bind operation may fail if the client 152
binding (i.e., is an asynchronous moniker) by calling an 15 waits too long before requesting more data.
ISAsyncMoniker API function (described below). The client On the other hand, in a data-push model, the asynchro
152 can further control whether the asynchronous moniker nous moniker 150 will drive the bind operation and con
150 performs binding asynchronously or synchronously by tinuously notifies the client whenever new data is available
setting a BINDF ASYNCHRONOUS flag when the asyn (i.e., by calling the client’s IBindStatusCallback::On
chronous moniker 150 calls an IBindStatusCallback::Get DataAvailable function). In such cases, the client 152 may
BindInfo function (described below) of the client's bind choose whether or not to read the data at any point during the
status-callback object 166 at the beginning of the bind bind operation, but the asynchronous moniker continues to
operation. drive the bind operation until completion.
When the client 152 specifies asynchronous binding, the 5.4 The IBinding Interface
asynchronous moniker 150 does not return an object or 25 The IBinding interface 160 is implemented by the asyn
storage pointer from the client's call to the IMoniker::Bind chronous moniker 150 on the binding object 164, which is
ToObject or IMoniker::BindToStorage function. Instead, the a separate object that the asynchronous moniker 150 creates
asynchronous moniker 150 returns the value, MS S on a per-bind operation basis. The IBinding interface 160
ASYNCHRONOUS, and a NULL pointer. The client 152 exposes member functions of the binding object 164 which
then waits to receive the requested object or Storage from the allow control of the bind operation performed by the binding
asynchronous moniker in a call to the client's IBindStatus object. The asynchronous moniker 164 provides the client
Callback::OnObject Available or IBindStatusCallback::On 152 with access to the IBinding interface 160 by passing a
DataAvailable function (described below). pointer of the IBinding interface to the client's bind-status
On the other hand, if the client does not set the BINDF callback object 166 via a call to the IBindStatusCallback
ASYNCHRONOUS flag, the asynchronous moniker syn 35 :: OnStartBinding function described below.
chronously binds the object or Storage, and returns the object The IBinding interface 160 is defined as follows:
or Storage from the client's call to the asynchronous moni
ker's IMoniker::BindToCbject or IMoniker::BindToStorage
function.
5.2 Asynchronous and Synchronous Storage 40 If--------------------------------------------------------------------------------------
If
In a call to the IBindStatusCallback: OnDataAvailable // Copyright (C) Microsoft Corporation, 1995-1996.
function (described below) during asynchronous binding to If
Storage, the asynchronous moniker 150 also may return an // Contents: IBinding interface definition
asynchronous Storage object. This asynchronous Storage If
If---------------------------------------------------------------------------------------
object Supports the IStream or IStorage interface (well 45 cpp quote(“#ifndef LPBINDING DEFINED)
known OLE interfaces), and its implementation of the cpp quote(“#define LPBINDING DEFINED)
functions in that interface allows access to Some of the data
object,
being bound while the binding is still in progreSS. The client uuid (79eac9c0-baf9-11ce-8c82-00aaOO4ba90b),
152 can choose between two modes for the asynchronous pointer default (unique)
Storage object: blocking and non-blocking. If data is not yet 50
available in the blocking mode (the default), the client's call interface IBinding: IUnknown
to the asynchronous Storage object blocks until the data {
typedefunique IBinding *LPBINDING:
arrives. In the non-blocking mode, the asynchronous Storage HRESULT Abort();
object returns an error value, E PENDING, to the client's HRESULT Suspend();
call when data is not yet available. In response, the client 55 HRESULT Resume();
waits for further notifications to its IBindStatusCallback HRESULT SetPriority(
in LONG nPriority);
:: On DataAvailable function before retrying the operation. HRESULT GetPriority(
The client 152 can choose between a synchronous out LONG * pnPriority);
(blocking) and asynchronous (non-blocking) storage by local HRESULT GetBindResult(
Out CLSID pclsidProtocol,
choosing whether or not to set the BIND F 60
Out DWORD *pdwResult,
ASYNCSTORAGE flag in the pgrfBINDF value which the Out LPOLESTR *pszResult,
client returns from the IBindStatusCallback::GetBindInfo in, out DWORD *pdwReserved);
function (described below) to the asynchronous moniker call as(GetBindResult)
150. HRESULT RemoteCietBindResult(
out CLSID pclsidProtocol,
5.3 Data-pull and Data-push Models 65 out DWORD *pdwResult,
The client 152 can choose between a data-pull and out LPOLESTR *pszResult,
data-push model for driving the asynchronous binding in the
US 6,401,099 B1
17 18
-continued TABLE 4
in DWORD dwReserved); Return Values of the IBinding:Resume Function
cpp quote(“#endif) Argument Type Description
Returns S OK Success
S FALS The bind operation was not
5.4.1 The IBinding: Abort Function E previously suspended.
E FAIL The suspended bind operation
1O could not be resumed.
The IBinding::Abort member function permanently
aborts the bind operation. After aborting the bind operation,
the client may still receive Some notifications about the 5.4.4 The IBinding::SetPriority Function
binding. The IBinding::SetPriority function establishes the priority
15
for the bind operation according to an input parameter,
An aborted bind operation will result in a call to the nPriority. The priority values are taken from the Microsoft
IBindStatusCallback::OnStopBinding function (described Corporations Win32 thread priority APIs
below) with a corresponding error code. Alternatively, the (SetThreadPriority and GetThreadPriority). The final prior
aborted bind operation results in a failure of the client's call ity is determined from values gathered from all clients of the
to the IMoniker::BindToCbject/BindToStorage function in bind operation. The parameter and return values of the
the Situation where that call has not previously returned. At illustrated IBinding::SetPriority function are shown in the
this point the bind operation is officially complete and the following table.
client must release any pointers obtained during the binding.
TABLE 5
The return values of the illustrated IBinding::Abort func
tion are shown in the following table: 25 IBinding::SetPriority Function Parameters and Return
Values
TABLE 2 Argument Type Description
Return Values of the IBinding::Abort Function nPriority LONG A value indicating the priority to
establish for this binding relative to
Argument Type Description other bindings and the system.
Returns S OK Success.
Returns S OK Success E FAIL The priority could not be changed.
S FALS The bind operation was already
E aborted.
E FAIL The bind operation could not be 5.4.5 The IBinding::GetPriority Function
aborted. 35
The IBinding::GetPriority function retrieves the current
priority of the bind operation. The priority values are taken
from the Win32 thread priority APIs (SetThreadPriority and
5.4.2 The IBinding::Suspend Function GetThreadPriority). The parameters and return values of the
The IBinding::Suspend function suspends the bind opera 40 illustrated function are shown in the following table.
tion. The bind operation will be suspended until resumed by TABLE 5
a later call to the IBinding::Resume function or canceled by
a call to the IBinding::Abort function. After calling IBind IBinding::GetPriority Function Parameters and Return
ing::Suspend the client may still receive Some notifications Values
about the bind operation. 45
Argument Type Description
The return values of the illustrated IBinding::Suspend pnPriority LONG* Location to return a value
Function are shown in the following table: indicating the priority
established for this binding
TABLE 3 50 relative to other bindings
and the system. May not
be NULL.
Binding:Suspend Function Return Values Returns S OK Success.
E INVALIDARG The pn Priority argument is
Argument Type Description invalid.
Returns S OK Success 55
S FALS The bind operation was already 5.5 The IBindStatusCallback Interface
E suspended.
E FAIL The bind operation could not be The IBindStatusCallback interface 162 exposes member
suspended. functions of the bind-status-callback object 166 provided by
the client 152. These members functions are called by the
60 asynchronous moniker 150 and binding object 164 to pro
5.4.3 The IBinding::Resume Function vide notifications to the client 152 relating to the bind
operation, e.g., the bind operation's Status and progreSS
The IBinding::Resume function resumes a Suspended updates. The asynchronous moniker 150 calls the notifica
bind operation. The bind operation must have been previ tion member functions of the IBindStatusCallback in the
ously Suspended by a call to the IBinding::Suspend function. 65 IMoniker::BindToCbject and BindToStorage functions, and
The return values of the illustrated IBinding::Suspend func the binding object 164 will continue to call the notification
tion are shown in the following table: member functions in an asynchronous bind operation after
US 6,401,099 B1
19 20
the asynchronous moniker returns from the BindToCbject or
BindToStorage function. -continued
The asynchronous moniker 150 also calls two member interface IBindStatusCallback: IUnknown
functions, the GetBindInfo and GetPriority functions
(described below), to receive additional information for the 5 typedef unique IBindStatusCallback
bind operation from the client 152. In its BindToCbject or *LPBINDSTATUSCALLBACK
BindToStorage function, the asynchronous moniker calls the typedef enum
IBindStatusCallback::GetBindInfo function (described {
BINDVERB GET = 0x00000000, if default action
below) to check at least the BINDF ASYNCHRONOUS BINDVERB POST = 0x00000001, If post verb
flag which indicates whether to perform the bind operation BIND VERB PUT = 0x00000002, II put verb
asynchronously. The asynchronous moniker 150 also may BINDVERB CUSTOM = 0x00000003, if custom verb
call the IBindStatusCallback::GetPriority to set the priority BINDVERB:
typedef enum
of the bind operation. Further, the asynchronous moniker
150 may call the IBindStatusCallback::QueryInterface func BINDINFOF URLENCODESTGMEDDATA = 0x00000001,
tion to request an interface pointer of a further interface of 15 If url encode the stgmed data
the client through which the asynchronous moniker can BINDINFOF URLENCODEDEXTRAINFO = OxOOOOOOO2,
If url encode the extra info
obtain further information or access additional or extended BINDINFOF:
Services. If flags that describe the type of transaction that caller wants
In the illustrated embodiment, the client 152 provides the typedef enum
bind-status-callback object 166 in association with a specific {
BINDF ASYNCHRONOUS = 0x00000001,
bind operation. The caller of the member functions exposed BINDF ASYNCSTORAGE = 0x00000002,
through the IBindStatusCallback interface thus need not BINDF NOPROGRESSIVERENDERING = 0x00000004,
pass information identifying the Specific bind operation. BINDF
BINDF
OFFLINEOPERATION
GETNEWESTVERSION
0x00000008,
0x00000010,
=
=
The client 152 registers the IBindStatusCallback interface BINDF NOWRITECACHE 0x00000020, =
of its bind-status-callback object 166 into the asynchronous 25 BINDF PULLDATA 0x00000080, =
bind context by calling the RegisterBindStatusCallback API BINDF IGNORESECURITYPROBLEM0x00000100, =
function described below. The asynchronous bind context BINDF RESYNCHRONIZE 0x00000200, =
BINDF HYPERLINK 0x00000400, =
registers only a single IBindStatusCallback interface at a BINDF COMPLETEDOWNLOAD 0x01000000, =
time (i.e., that of the last client to call the RegisterBindSta BINDF INLINESGETNEWESTVERSION = 0x1OOOOOOO,
tusCallback API function). However, the RegisterBindSta BINDF INLINESRESYNCHRONIZE = 0x20000000,
tusCallback API function returns an interface pointer of the BINDF CONTAINER NOWRITECACHE = 0x40OOOOOO
previously registered IBindStatusCallback interface to allow BINDF:
typedef struct tagBINDINFO
chaining of IBindStatusCallback interface notifications {
between multiple clients. So that notifications can be ULONG cbSize:
chained to multiple clients through the registered client, the 35 LPWSTR szExtraInfo: If e.g. string added to the URL
string range byte
client with the registered IBindStatusCallback interface will STGMEDIUM stgmedData; // e.g. put or post data
receive all IBindStatusCallback notifications from the asyn DWORD grfBindInfoF; // e.g. how meddata should be
chronous bind context. The asynchronous moniker 150 treaded
retrieves the interface pointer of the IBindStatusCallback DWORD dwBindVerb; if e.g. put, post, ...
interface which is registered for a particular bind operation 40 LPWSTR SzCustomVerb; if e.g. custom verb
DWORD cbstgmedData; // size of data in stgmed Data
from the asynchronous bind context in its IMoniker::Bind BINDINFO:
ToObject or BindToStorage member functions. typedef struct tagRemBINDINFO
If the asynchronous moniker 150 invokes other monikers {
as part of the bind operation, the asynchronous moniker may ULONG cbSize:
LPWSTR szExtraInfo: If e.g. string added to the URL
register its own IBindStatusCallback interface (not shown) 45 string range byte
in the asynchronous bind context to receive notification from DWORD grfBindInfoF; // e.g. how meddata should be
treaded
the other moniker. The notifications through the IBindSta DWORD dwBindVerb; if e.g. put, post, ...
tusCallback interfaces of more than one moniker involved in
LPWSTR SzCustomVerb; if e.g. custom verb
a bind operation can thus be chained to provide consolidated DWORD cbstgmedData; // size of data in stgmed Data
progreSS notifications. 50 RemBINDINFO:
The definition of the IBindStatusCallback interface 162 typedef struct tagRemFORMATETC {
and related data Structures is as follows: DWORD cfFormat:
DWORD ptd;
DWORD dwAspect;
LONG lindex;
55 DWORD tymed;
If----------------------------------------------------------------- RemFORMATETC, *LPREMFORMATETC;
If If Data notification flags
// Copyright (C) Microsoft Corporation, 1995-1996. typedef enum
If {
If Contents: IBindStatus.Callback interface definition BSCF FIRSTDATANOTIFICATION = 0x00000001,
If 60
BSCF INTERMEDIATEDATANOTIFICATION
If-------------------------------------------------------------------- = 0x00000002,
cpp quote(“#ifndef LPBINDSTATUSCALLBACK DEFINED) BSCF LASTDATANOTIFICATION = OxOOOOOOO4
cpp quote(“#define LPBINDSTATUSCALLBACK DEFINED) BSCF;
typedef enum tagBINDSTATUS
object, {
uuid (79eac9c1-baf-11 ce-8c82-00aaOO4ba90b), 65
BINDSTATUS FINDINGRESOURCE = 1
pointer default (unique) BINDSTATUS CONNECTING
BINDSTATUS REDIRECTING
US 6,401,099 B1
21 22
-continued TABLE 6-continued
BINDSTATUS BEGINDOWNLOADDATA BINDVERB Enumeration Values
BINDSTATUS DOWNLOADINGDATA
BINDSTATUS ENDDOWNLOADDATA Value Description
BINDSTATUS BEGINDOWNLOADCOMPONENTS
BINDSTATUS INSTALLINGCOMPONENTS BIND VERB PUT Perform a “put operation. The data to put
BINDSTATUS ENDDOWNLOADCOMPONENTS should be specified in the stgmedData
BINDSTATUS USINGCACHEDCOPY member of the BINDINFO.
BINDSTATUS SENDINGREQUEST BINDVERB CUSTOM Perform a custom operation (protocol
BINDSTATUS CLASSIDAVAILABLE specific, see SZCustomVerb member of
BINDSTATUS MIMETYPEAVAILABLE BINDINFO). The data to use should be
BINDSTATUS CACHEFILENAMEAVAILABLE specified in the stgmed Data member of the
BINDSTATUS BEGINSYNCOPERATION BINDINFO.
BINDSTATUS ENDSYNCOPERATION
BINDSTATUS:
HRESULT OnStartBinding.( 15 5.5.2 The BINDINFOF Enumeration
in DWORD dwReserved, The BINDINFOF enumeration defines values that are
in IBinding * pib); passed to the client 152 within the IBindStatusCallback
HRESULT GetPriority( ::GetBindInfo function to specify additional flags for con
out LONG * pnPriority);
HRESULT On LowResource( trolling the bind operation. The values in the illustrated
in DWORD reserved): embodiment are shown in the following table.
HRESULT OnProgress(
in ULONG ulProgress, TABLE 7
in ULONG ulProgressMax,
in ULONG ulStatusCode, BINDINFOF Enumeration Values
in LPCWSTR szStatusText):
HRESULT OnStopBinding.(
in HRESULT hiresult, 25 Value Description
in, unique LPCWSTR szError); BINDINFOF URLENCODESTG Use URL encoding to pass is
local MEDDATA the data provided in the
HRESULT GetBindInfo( stgmed Data member of the
out DWORD grfBINDF, BINDINFO. (for PUT and POST
in, out, unique BINDINFO * pbindinfo); operations)
call as(GetBindInfo) BINDINFOF URLENCODEEXT Use URL encoding to pass is
HRESULT RemoteCietBindInfo( RAINFO the data provided in the
out DWORD grfBINDF, SzExtranfo member of the
in, out, unique RemBINDINFO * pbindinfo, BINDINFO.
in, out, unique RemSTGMEDIUM pstgmed):
local
HRESULT OnDataAvailable( 35 5.5.3 The BINDINFO Structure
in DWORD grfBSCF, The BINDINFO structure is returned to the asynchronous
in DWORD dwSize
in FORMATETC pformatetic, moniker 150 from the asynchronous moniker's call to the
in STGMEDIUM* pstgmed); IBindStatusCallback::GetBindInfo function. The client 152
call as(OnDataAvailable) of the asynchronous moniker 150 uses this structure to
HRESULT RemoteonDataAvailable( 40 qualify the bind operation. The meaning of this structure
in DWORD grfBSCF,
in DWORD dwSize, generally is specific to the class of the asynchronous moni
in RemFORMATETC *pformatetic, ker 150. The following table summarizes the meaning of the
in RemSTGMEDIUM* pstgmed); data values in the structure for the illustrated URL moniker
HRESULT OnObjectAvailable( class of asynchronous moniker described below.
in REFIID rid, 45
in, iid is(riid) IUnknown punk);
TABLE 8
cpp quote(“#endif)
BINDINFO Structure Members
format, the world wide web site for the URL responds by rgfmtetc CLIPFORMAT: Static array of formats.
ppenumfmtetc EnumEORMATETC** Location to return the
returning the MIME media type of “image/gif” and option IEnumEORMATETC
ally the image data itself in the GIF format if the call was a interface of the
request-for-data. enumerator.
The client 202 is notified of the actual data format that it 15 Returns S OK Success.
E INVALIDARG One or more arguments
receives during the bind operation of the BindToStorage are invalid.
function through the pformatetic argument on the client's
IBindStatusCallback: OnDataAvailable function. 6.1.3 The RegisterFormatEnumerator API Function
6.1.1 The RegisterMediaTypes API Function The client 202 calls this API function to register the
This API function registers text strings of MIME media format enumerator object 220 onto the bind context 156.
types with corresponding clipboard format values for use in This allows the URL moniker 200 to query for the client's
clipboard format value to MIME media type mapping by the preferred data formats for media type negotiation in a
URL moniker 200 in media type negotiation for the client 25
Subsequent bind operation as described above. The Regis
202. The RegisterMediaTypes API function has the follow terFormat numerator API function has the following form:
ing form:
HRESULT RegisterMediaTypes(ctypes, rgszTypes, HRESULT RegisterFormatEnumerator(pbc, pFFetc, dwReserved);
rgcfTypes);
The parameters and return values of the RegisterMedi
aTypes API function are shown in the following table. The parameters and return value of the RegisterFormat
numerator API function are shown in the following table.
TABLE 30
TABLE 32
RegisterMediaTypes API Function Parameters and 35
Return Values. RegisterFormatEnumerator API Function Parameters and
Return Values.
Argument Type Description
Argument Type Description
ctypes UINT The number of media type strings in
the rgSZTypes array. May not be 40 pbc LPBC The pointer to the bind
ZCO. context.
rgSZTypes LPTSTR* Array of strings identifying the media pEFetc EnumEORMATETC* The format enumerator.
types to be registered. None may be dwReserved DWORD Reserved for future use,
NULL. must be Zero.
rgcfTypes CLIPFORMAT: An array of 32-bit values that should Returns S OK Success.
be assigned to the corresponding 45 E INVALIDARG One or more arguments are
media types in rgSZTypes. invalid.
Returns S OK Success.
E INVALIDAR One or more arguments are invalid.
G 6.1.4 The RevokeFormat numerator API Function
50
The client 202 calls this API function to removes the
6.1.2 The CreateEormat numerator API Function format enumerator object 220 from registration with the
asynchronous bind context 156. The API function has the
This function creates an object which implements the following form:
IEnumFORMATETC interface over a static array of FOR HRESULT RevokeFormatEnumerator(pbc, pEFetc);
MATETC data structures. The client 202 can call this API
function to create the format enumerator object 220 for use
55 The parameters and return values of the RevokeFormat
in media type negotiation with the URL moniker 200. The numerator API function are shown in the following table.
Createformat numerator API function has the following TABLE 33
form:
60 RevokeFormat numerator API Function Parameters and
Return Values.
If----------------------------------------------------------------------------
If If----------------------------------------------------------------------------
// Copyright (C) Microsoft Corporation, 1995-1996. If
If // Copyright (C) Microsoft Corporation, 1995-1996.
If Contents: IAuthenticate interface definition If
If 35 If Contents: IHttpNegotiate interface definition
If---------------------------------------------------------------------------- If
cpp quote(“#ifndef LPAUTHENTICATION DEFINED) If----------------------------------------------------------------------------
cpp quote(“#define LPAUTHENTICATION DEFINED) cpp. quote(*#ifndef LPHTTPNEGOTIATE DEFINED)
cpp quote(“#define LPHTTPNEGOTIATE DEFINED)
local, 40
object, object,
uuid(79eac9d0-baf9-11ce-8c82-00aaOO4ba90b), uuid (79eac9d2-baf'9-11ce-8c82-00aaOO4ba90b),
pointer default (unique) pointer default (unique)
It is certified that error appears in the above-identified patent and that said Letters Patent is
hereby corrected as shown below:
Column 57
Line 61, “indicative indicative' Should read -- indicative --.
Column 59
Line 54, "program furthr” should read -- program further --.
Column 60
Line 5, “the object-oriented” should read -- The object-oriented --.
Line 34, "application to' Should read -- application program to --.
Line 60, “comprising:” should read -- further comprising: --.
Column 62
Line 9, “applicatino” should read -- application --.
Lines 17-18, “indenpendently” should read -- independently --.
WDJ
JON W. DUDAS
Acting Director of the United States Patent and Trademark Office