15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Dynamically loaded mfcext dlls?

Martin Wawrusch -- wawrusch@accs.co.at
Sunday, January 14, 1996

Hi!
We have lot's of database access stuff (At the moment DAO but perhaps
DBTools++ in the near future) that we would like to encapsulate in
several dlls. For example, to access accounts one would use the
accounts dll. All the classes within the dlls have the same interfaces.
We would like to dynamically load and unload the dlls on demand without
loosing the C++ features. How can this be acomplished with MFC?
It seems that the new OCX container support does such a dynamic wrapping
for OCXes. We haven't found anything similar for dlls, however.

Second question (although not MFC related - sorry):

Do we loose anything when we use OCXe (Approximately 200) instead of
ordinary DLLs?

Martin

-- 
Martin Wawrusch			| ESBMASAP, BNS  A. Einstein
ACCS Software			| Tel. : +43 1 983 46 91 
Huetteldorferstr. 163/23	| Fax. : +43 1 983 01 00
A-1140 Vienna, Austria		| EMail: wawrusch@accs.co.at



Mike Blaszczak -- mikeblas@interserv.com
Tuesday, January 23, 1996

On Sun, 14 Jan 1996, Martin Wawrusch  wrote:
>Hi!
>We have lot's of database access stuff (At the moment DAO but perhaps
>DBTools++ in the near future) that we would like to encapsulate in
>several dlls. For example, to access accounts one would use the
>accounts dll. All the classes within the dlls have the same interfaces.
>We would like to dynamically load and unload the dlls on demand without
>loosing the C++ features. How can this be acomplished with MFC?

You should read the technote which describes DLL programming. It outlines a 
way to use AfxLoadLibrary() instead of ::LoadLibrary(), and AfxFreeLibrary() 
instead of ::FreeLibrary(), and how to write a call to AfxTerminateLibrary() 
in your DllMain() function so that MFC can hook and unhook your library as 
you decide to load and discard it.

This will only work in MFC 4.0 or newer.

.B ekiM
--
TCHAR szDisc[] = _T("These words are my own; I do not speak for Microsoft.");





| Вернуться в корень Архива |