IonicWind Software

Aurora Compiler => GUI => Topic started by: Parker on May 28, 2006, 10:52:30 PM

Title: Dialog won't show
Post by: Parker on May 28, 2006, 10:52:30 PM
And this time it's not something I can move into main( ) ;)

I have my subroutine to show the dialog:
global sub ShowSingleDlg( CWindow *parent, SingleFileDlgSpec spc ),int
{
SingleFileDlg d1;

d1.spc = &spc;

d1.Create(0,0,398,117,0x80C80080,0,"Build Single",parent);
d1.AddControl(CTEDIT,spc.output,85,13,223,20,0x50800000,0x200,EDIT_1);
d1.AddControl(CTSTATIC,"Output:",12,17,70,16,0x5000010B,0x0,STATIC_2);
d1.AddControl(CTBUTTON,"Browse",312,13,70,20,0x50000000,0x0,BUTTON_3);
d1.AddControl(CTSTATIC,"Output Type:",12,48,70,20,0x5000010B,0x0,STATIC_4);
d1.AddControl(CTCOMBOBOX,"",85,46,117,29,0x50800603,0x0,COMBO_5);
d1.AddControl(CTCHECKBOX,"Debug Build",211,46,173,20,0x50000003,0x0,CHECK_6);
d1.AddControl(CTBUTTON,"Cancel",238,80,70,20,0x50000000,0x0,BUTTON_7);
d1.AddControl(CTBUTTON,"Build",312,80,70,20,0x50000000,0x0,BUTTON_8);

return d1.DoModal();
}


but when I call that subroutine from MdiParent::OnControl, nothing happens (doesn't show, just returns 0)
if( ShowSingleDlg( this, spc ) == 2 ) { /* some code is in here */ }

Most likely I'm doing something wrong and not Aurora, I'm just not sure what ???
Title: Re: Dialog won't show
Post by: Ionic Wind Support Team on May 28, 2006, 11:01:10 PM
Change it to:

result = d1.DoModal();
return result;

And you'll be fine.  A RETURN statment causes any objects allocated on the stack to have their destructors called.  Something to remember for the future ;)

Title: Re: Dialog won't show
Post by: Parker on May 29, 2006, 12:04:35 PM
Thanks, the dialog shows now. Definitely something to remember.