상세 컨텐츠

본문 제목

MFC 확장 DLL에 포함된 다이얼로그를 생성할때 Create() 에서 실패하는 경우에 참고할 점

컴퓨터 언어/MFC

by cepiloth 2021. 9. 23. 17:29

본문

728x90
반응형

아래 내용과 같이 Custom Class 의 RegisterWindowClass() 안에서 윈도우 스타일에 CS_GLOBALCLASS를 추가

After using AfxGetInstanceHandle() to load a language DLL for my application I 
found the resource dialogs which contained the custom controls began to fail
from within CreateDialogIndirect.

When a window class is registered that class name is good for that application's
instance. After loading the language DLL the dialogs now reside within a separate
instance. 

The solution I found was to add CS_GLOBALCLASS to the class registration.
wndcls.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;

Further reading: 
Registering a Class in a DLL

 

 

Reference

https://bluebami.tistory.com/28 [주관적인 일상]

728x90
반응형

관련글 더보기

댓글 영역