I post user defined create window message from the main thread,and call the CreateWindow() function ,but it does't return NULL or valid HWND,just stay still there.
Any guys have faced this issue?
Thanks.
Below is part of the code:
std::cout << " begin create window..... " << std::endl;
globals->new_window = CreateWindowEx (0,globals->window_class_name, TEXT(""),
globals->dwStyle,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, globals->hInstance, NULL);
std::cout << "end create window ... " << std::endl;
I post the msg in main thread:
globals->dwStyle = dwStyle_;
if (PostMessage(globals->helper_window,WM_USER+CREATE_WINDOW,0,0)==0)
{
throw gui_error("Unable to schedule function for execution in event handling thread.");
}
It print the
begin create window.....
,but not go down.
What I have tried:
I have checked all the code ,but not work.