mfc - Messagebox in CMainFrame OnCreate -


i have old mfc application oncreate function spans upwards of 200 lines.

cmainframe::oncreate(lpcreatestruct lpcreatestruct) { ... postmessage(load_images,0,0); ... validatepermissions(); ... } 

the load_images user message handler tries load images had been unsaved last session.. tries create new cdocument...

the validatepermissions function pops modal messagebox if finds permissions missing..

i notice if have modal message box pop up, crash when load_images handler fires (since cannot create cdocument, think because cmainframe has not yet created).

how should handling such case. there documentation suggests not have modal messageboxes in oncreate?

try moving call validatepermissions message handler load_images. should let window creating complete before let message box pump messages.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -