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

Вниз

ActiveX & Thread   Найти похожие ветки 

 
oleg_art   (2003-04-22 12:46) [0]

Как правильно работать с ActiveX в потоке ? Дело в том, что
не используя поток он работает ! Возможно, необходимо выполнить какую-то инициализацию (в книге Елмановой Н "Delphi 6 и технология COM" ничего по этому поводу не сказано).
Заранее thanks.


 
Digitman   (2003-04-22 13:17) [1]

поточная ф-ция, работающая с ActiveX, должна при старте вызвать CoInitialize(nil), а финишируя - CoUnInitialize() (безусловно)


 
oleg_art   (2003-04-22 13:24) [2]

2 DigitMan
Я тоже так думал. Но эти функции работают только для внепроцессорных exe - COM-ов (так сказано у Елмановой и проверено на практике). ActiveX - он внутрипроцессорный.
Может, кто знает. Подскажите !!!


 
Digitman   (2003-04-22 13:30) [3]

The CoInitialize function initializes the Component Object Model(COM) library. You must initialize the library before you can call its functions. Applications must call CoInitialize before they make any other COM library calls with two exceptions: the CoGetMalloc function, and memory allocation calls.

HRESULT CoInitialize(

LPVOID pvReserved //Reserved, must be NULL
);
Parameter

pvReserved

In 32-bit OLE, this parameter must be NULL. The 32-bit version of OLE does not support applications replacing OLE"s allocator and if the parameter is not NULL, CoInitialize returns E_INVALIDARG.

Return Values

S_OK

Indicates the library was initialized successfully.

S_FALSE

Indicates that the library is already initialized or that it could not release default allocator.

E_OUTOFMEMORY

Indicates that it was unable to initialize because the system is out of memory.

E_INVALIDARG

Indicates the argument is invalid.

E_UNEXPECTED

Indicates an unexpected error occurred.

Comments

You need to call this before you call any of the OLE library functions unless you call the OleInitialize function, which calls CoInitialize internally.
Typically, CoInitialize is called only once in the process that uses the OLE library. There can be multiple calls, but subsequent calls return S_FALSE. To close the library gracefully, each successful call to CoInitialize
, including those that return S_FALSE, must be balanced by a corresponding call to the CoUninitialize function.


Это - фрагмент хэлпа.

ну и где здесь видно хотя бы слово об InProc/OutOfProc-фабриках/серверах ?



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

Форум: "Основная";
Текущий архив: 2003.05.05;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.007 c
3-12642
-=Oscar=-
2003-04-15 13:06
2003.05.05
Как создать новую БД в InterBase из Delphi?


14-12933
Vlad Oshin
2003-04-16 15:35
2003.05.05
кто сажал Win2000sp1-2 на Cel-266/ 64 ОЗУ / 2гб винт?


14-12892
zatochka
2003-04-16 22:26
2003.05.05
Как сдаелать программу невидимой


1-12784
DDF
2003-04-22 10:40
2003.05.05
[Error] на значении Nil


14-12919
lipskiy
2003-04-17 00:19
2003.05.05
32-битные иконки в стиле WinXP





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
Английский Французский Немецкий Итальянский Португальский Русский Испанский