Re: диалоговое окно в dll
От: SchweinDeBurg Россия https://zarezky.spb.ru/
Дата: 09.04.08 03:13
Оценка:
Здравствуйте, ch_andr, Вы писали:

_>4. В файл добавлена следующая функция для создания и открытия окна


_>
_>extern "C" __declspec(dllexport) int MyInit(int i)
_>{
_>    CDialog_my MyDialog;//Обьект класса class CDialog_my : public CDialog
_>    MyDialog.DoModal();//Собственно создаем модальное окно
_>    return 1;
_>}
_>


MFC's common window procedure automatically switches to the correct module state, so you don't need to worry about it in any message handlers implemented in your regular DLL. But when your executable calls into the regular DLL, you do need to explicitly set the current module state to the one for the DLL. To do this, use the AFX_MANAGE_STATE macro in every function exported from the DLL. This is done by adding the following line of code to the beginning of functions exported from the DLL:

AFX_MANAGE_STATE(AfxGetStaticModuleState( ))

[ posted via RSDN@Home 1.1.4 stable SR1 r568, accompanied by silence ]
- Искренне ваш, Поросенок Пафнутий
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.