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
Post a Comment