0
오류없이 컴파일되고 실행됩니다. 유일한 것은 창이 나타나지 않는다는 것입니다. 소멸자는 내가 창문을 닫을 때까지 영원히 머물러야합니까?클래스에 코드를 넣었을 때이 리치 헷드 창이 표시되지 않는 이유는 무엇입니까?
#include <windows.h>
#include <richedit.h>
class richEdit {
HWND richeditWindow;
richEdit() {
HMODULE richedit_library = LoadLibrary("Msftedit.dll");
if (NULL == richedit_library) abort();
HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(0);
richeditWindow = CreateWindowExW (
WS_EX_TOPMOST,
MSFTEDIT_CLASS,
L"window text",
WS_OVERLAPPED | WS_SYSMENU | ES_MULTILINE | WS_VISIBLE,
0, 0, 500, 500,
NULL, NULL, hInstance, NULL
);
}
~richEdit() {
MSG msg;
while(GetMessageW(&msg, richeditWindow, 0, 0)) {
TranslateMessage(&msg);
DispatchMessageW(&msg);
}
}
};
int main() {
richEdit re();
}