Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Corba";
Текущий архив: 2006.02.19;
Скачать: [xml.tar.bz2];

Вниз

How Child IDs Are Used in Parameters   Найти похожие ветки 

 
Kerk ©   (2005-04-19 19:11) [0]

Практически ничего не понял из данной статьи :)... кто-нибудь может в двух словах понятным для чайника образом ее содержание пояснить?

This topic describes input parameters, output parameters, and special cases for interpreting child IDs returned from IAccessible methods.

Input Parameters
Many of the Active Accessibility functions and most of the IAccessible properties take a VARIANT input parameter. For most of the IAccessible properties, this parameter allows client developers to specify whether they want information about the object itself or about one of the object"s simple elements.

Active Accessibility provides the constant CHILDID_SELF to indicate that information is needed about the object itself. To obtain information about a simple element, client developers specify its child ID in the VARIANT parameter.

When initializing a VARIANT parameter, be sure to specify VT_I4 in the vt member in addition to specifying the child ID value (or CHILDID_SELF) in the lVal member.

For example, to get the name of an object, and not one of the object"s child elements, initialize the variant for the first parameter of IAccessible::get_accName ( CHILDID_SELF in the lVal member and VT_I4 in the vt member), and then call IAccessible::get_accName.

Output Parameters
Several IAccessible functions and methods have a VARIANT* output parameter that contains a child ID or an IDispatch interface pointer to a child object. There are different steps that a client must take depending on whether they receive a VT_I4 child ID (simple element) or an IDispatch interface pointer with CHILDID_SELF (full object). Following these steps will provide an IAccessible interface pointer and child ID that together allow clients to use the IAccessible methods and properties. These steps apply to the IAccessible accHitTest, get_accFocus, and get_accSelection methods. They also apply to the AccessibleObjectFromEvent, AccessibleObjectFromPoint, and AccessibleObjectFromWindow client functions.

The following table lists the possible result returned and the required post-processing steps so that clients will have an IAccessible interface pointer and child ID.
--
IDispatch interface pointer
This is a full object.
Call QueryInterface to access the IAccessible interface pointer.

Use the IAccessible interface pointer with CHILDID_SELF to access IAccessible methods and properties.
--
VT_I4 childID
Call IAccessible::get_accChild using the childID to see if you have an IDispatch interface pointer.
If you get an IDispatch interface pointer, use it with CHILDID_SELF to access IAccessible interface methods and properties.

If the call to get_accChild fails, you have a simple element. Use the original IAccessible interface pointer (the one you used in your call to the method or function mentioned above) with the VT_I4 childID that the call returned.
--
Before you can use a VARIANT parameter, you must initialize it by calling the VariantInit COM function. When finished with the structure, call VariantClear to free the memory reserved for that VARIANT.

Special Cases
There are exceptions to the guidelines in the above table, such as when a child ID is returned by the IAccessible::accHitTest method. Servers must return an IDispatch interface if the child is an accessible object. If a child ID is returned by IAccessible::accHitTest, the child is a simple element.

In addition, there are special cases for accNavigate. For more information, see IAccessible::accNavigate and Spatial and Logical Navigation.


 
Набережных С. ©   (2005-04-20 08:22) [1]

Многие функции и методы принимают входной параметр типа Вариант. Для большинства свойств этот параметр определяет, какая информация требуется - о самом объекте или об одном из его дочерних элементов.

Active Accessibility поддерживает константу CHILDID_SELF, которая указывает, что затребована информация о самом объекте. Для получения информации об элементе клиент указывает его ID in VARIANT parameter.

Тип содержимого варианта должен быть VT_I4, 32-хразрядное целое со знаком. На дельфи можно так
 V:=ID;
 TVarData(V).VType:=VT_I4;

Output Parameters
Некоторые функции и методы имеют выходной параметр типа вариант, в котором возвращают ID дочернего элемента либо его IDispatch.
Если это IDispatch, то можно через него получить IAccessible этого объекта и обращаться к методам этого дочернего объекта, используя CHILDID_SELF.

Ecли это дочерний ID, то можно его передать в функцию get_accChild родителя для получения IDispatch этого ребенка. Если get_accChild вернет отказ, то значит нет у него интерфейсов.

Ну специальной инициализации вариантов в дельфи делать не надо.

Вроде все.



Страницы: 1 вся ветка

Форум: "Corba";
Текущий архив: 2006.02.19;
Скачать: [xml.tar.bz2];

Наверх




Память: 0.46 MB
Время: 0.045 c
6-1131514245
Дядюшка Сэм
2005-11-09 08:30
2006.02.19
Help


2-1138526331
начинающий5
2006-01-29 12:18
2006.02.19
RXLib


15-1138265524
AlexD
2006-01-26 11:52
2006.02.19
Windows XP


4-1133252484
*Pavel
2005-11-29 11:21
2006.02.19
Развернуть чужое окно


2-1138750519
atmospheric
2006-02-01 02:35
2006.02.19
наследование класса





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский