|
| БЕСПЛАТНАЯ ежедневная online лотерея! Выигрывай каждый день БЕСПЛАТНО! |
|
|
File Viewer Structure and Implementation
A file viewer is an OLE component object in an in-process server DLL where the object implements the IPersistFile and IFileViewer interfaces. The in-process server exports the DllGetClassObject and DllCanUnloadNow functions, implements a class factory object with the IClassFactory interface, and implements the file viewer object with the interfaces required. The following illustration shows the structure of a file viewer.
There are a number of reasons why a file viewer is best implemented in a DLL with the given interfaces. In general, a DLL is faster to load and usually comes in a small package. In the future, these same DLLs will provide other nonuser interface features, such as content indexing, and a component object DLL will be the most efficient and fastest way to access those features. In some cases, a file viewer object may need to display pop-up windows and process messages through its own message loop as in Windows 95. The DLL structure still allows this when used in conjunction with a stub process like Quick View, which gives the file viewer DLL the right to execute a message loop.
The IPersistFile interface in the file viewer object is intended to be a general mechanism through which the object is given a path for a file. From then on, the component that loaded the object can ask it to do any number of things with the file. Through Quick View, the Windows 95 shell asks the object to show the file by using the IFileViewer::ShowInitialize and IFileViewer::Show member functions or asks the object to print the file to a specific printer by using the IFileViewer::PrintTo member function. In the future, the shell may ask the object to perform content indexing, which would happen through an interface other than IFileViewer. For this reason, the file loading member functions of IPersistFile are separate from the operations that perform on the file, which is why IFileViewer was not just extended with its own Load member function. This latter option is a little more efficient (because it avoids IPersistFile entrypoint functions that are not implemented), but the design given here is easier to extend.
| Пригласи друзей и счет твоего мобильника всегда будет положительным! |
| Пригласи друзей и счет твоего мобильника всегда будет положительным! |
Файловая Структура Зрителя и Реализации
Файловый абонент является компонентным объектом OLE в сервере изготовления DLL где объект осуществляет IPersistFile и интерфейсы IFileViewer. Сервер изготовления экспортирует DllGetClassObject и функции DllCanUnloadNow, осуществляет заводской объект класса с интерфейсом IClassFactory и осуществляет файловый объект абонента с необходимыми интерфейсами. Следующая иллюстрация показывает структуру файлового абонента.
Есть множество причин почему файловый абонент наилучшим образом осуществлен в DLL с данными интерфейсами. В общих чертах, DLL быстрее должен загружать и обычно входит в небольшой пакет. В будущем, эти то же DLLs обеспечит другие характеристики nonuser интерфейса, как например, содержимое, индексирующее, и компонентный объект DLL будет наиболее эффективным и самым быстрым путем иметь доступ к тем характеристикам. В некоторых случаях, файловый объект абонента возможно нужно отображать управляющее окно и обрабатывать сообщения через свой собственный цикл сообщения как в Windows 95. Структура DLL все еще допускает это когда использовано в связи (вместе)с процессом заглушки подобно Быстрому Виду, который дает файловому абоненту DLL право выполнять цикл сообщения.
Интерфейс IPersistFile на файловом объекте абонента собирается быть общим механизмом через который объект дан путь для файла. В дальнейшем, компонент, который загружал объект может спросить, чтобы это делало любым количеством вещей с файлом. Через Быстрый Вид, оболочка Windows 95 спрашивает объект против показывать файл используя IFileViewer::ShowInitialize и IFileViewer::элемент Показа функционирует или спрашивает объект против распечатки файл в специфический принтер используя IFileViewer::функция элемента PrintTo. В будущем, оболочка может спросить объект против выполнять содержимое индексируя, который должен случаться через интерфейс кроме IFileViewer. По этой причине, файл, загружающий функции элемента IPersistFile выделять с операций, которые выполняются в файле, который - почему IFileViewer только что не был расширен своей функцией элемента собственной Загрузки. Эта последняя опция будет чуть-чуть эффективный (поскольку она избегает IPersistFile entrypoint функций, что не осуществлены), но проект данный здесь легче должен расширяться.
|
|
|
|
| |