|
|
От: |
SchweinDeBurg
|
https://zarezky.spb.ru/ |
| Дата: | 09.04.08 03:13 | ||
| Оценка: | |||
_>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( ))