How to show a window before processing in MFC -



How to show a window before processing in MFC -

how can window visible before processing?

i'm trying this:

void cmyclass::onbutton1clicked() { cstring class_str = afxregisterwndclass(cs_vredraw | cs_hredraw, ::loadcursor(null,idc_arrow),(hbrush)::getstockobject(white_brush),::loadicon(null, idi_application)); cwnd* wnd = new cwnd(); wnd->create(class_str,"test",ws_child | ws_visible | ws_border, crect(0,0,100,100), afxgetmainwnd(), 1432); //afxmessagebox("test"); // <- if executed wnd gets visible before sleep() sleep(5000); //this processing wnd->destroywindow(); delete wnd; return; }

the window doesn't show @ all. i've tried displaying in ui thread doesn't show either. if message loop until window created, shows after while main message loop asserts.

i know shouldn't made rather processing in worker thread, current code i'm working require changes big.

disclaimer: don't know mfc, know windows api, mfc built on top of.

perhaps need create phone call showwindow(). also, handling wm_create message? if so, perhaps returning wrong value.

if above doesn't apply or create sense, disregard.

mfc

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -