Creating Resource in DLL for Reuse, MFC / VC ++

For example, I want to create a DLL that exports a ShowDialog function that displays a dialog and changes the text in one of the dialog buttons. The dialog and all other resources must be combined in a DLL.

I did a quick test, and when the DLL tries GetDlgItem () with a specific control identifier, it returns a null pointer. I suggest that in this case additional steps will be required for proper resource management.

+3
source share
2 answers

From MSDN :

MFC . DLL, DLL, DLL. . :

AFX_MANAGE_STATE(AfxGetStaticModuleState());
+3

- DLL?

AFX_MANAGE_STATE(AfxGetStaticModuleState( ))

technote MFC. MFC, - .

AfxGetStaticModuleState .

DLL AFX_MODULE_STATE . MFC . DLL. MFC AFX_MODULE_STATE. MFC . .

+4

Source: https://habr.com/ru/post/1702960/


All Articles