Click here to Skip to main content
15,890,506 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Why this code alway crash my app?Need help. Pin
Teerayoot3-Dec-04 2:26
Teerayoot3-Dec-04 2:26 
GeneralRe: Why this code alway crash my app?Need help. Pin
David Crow3-Dec-04 3:25
David Crow3-Dec-04 3:25 
GeneralRe: Why this code alway crash my app?Need help. Pin
Teerayoot3-Dec-04 4:48
Teerayoot3-Dec-04 4:48 
GeneralCompilation Times in VS C++ .NET Pin
haggersr2-Dec-04 8:17
haggersr2-Dec-04 8:17 
Generalresizing dialog box Pin
haseeb_saeed2-Dec-04 8:05
haseeb_saeed2-Dec-04 8:05 
GeneralRe: resizing dialog box Pin
kdehairy2-Dec-04 10:37
kdehairy2-Dec-04 10:37 
GeneralRe: resizing dialog box Pin
haseeb_saeed3-Dec-04 3:01
haseeb_saeed3-Dec-04 3:01 
GeneralRe: resizing dialog box Pin
John R. Shaw2-Dec-04 16:06
John R. Shaw2-Dec-04 16:06 
Actualy the Windows calculator probably does not resize at all. It most likely consist of 2 different dialog boxes. When the user decides to switch caculator views, that is what it does.

1) Create 2 dialog boxes: normal and scientific.
Remember to use the same IDs for the buttons, etc... that do the same thing.
2) Create a CDialog based class for the scientific dialog only, since you only need one class to handle all the commands.
3) Now when the user selects a new veiw call EndDialog(some known value).
Example:
if( dialogID == IDD_NORMAL )
    EndDialog(IDD_SCIENTIFIC).
else
    EndDialog(IDD_NORMAL).

4) Finaly your code calling DoModal() (to show your dialog) needs to look something like this:
...
int result = IDD_NORMAL.
do {
    if( result != IDD_NORMAL || result != IDD_SCIENTIFIC )
        break; // something happen that should not have
    { // required
        CMyDialog dlg(result);
        result = dlg.DoModal
    } // dlg destroyed here
  // FYI: IDOK = 1, IDCANCEL = 2
} while( result != IDOK && result != IDCANCEL );

Any way that is most likely how I would do it. You ought to be able to figure out the rest.

Good Luck!

INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
GeneralRe: resizing dialog box Pin
haseeb_saeed3-Dec-04 3:03
haseeb_saeed3-Dec-04 3:03 
GeneralProblem Redrawing Screen Pin
doctorpi2-Dec-04 7:39
doctorpi2-Dec-04 7:39 
GeneralCStringArray Pin
LeeeNN2-Dec-04 6:51
LeeeNN2-Dec-04 6:51 
GeneralRe: CStringArray Pin
Maximilien2-Dec-04 7:03
Maximilien2-Dec-04 7:03 
GeneralRe: CStringArray Pin
BlackDice2-Dec-04 7:53
BlackDice2-Dec-04 7:53 
GeneralRe: CStringArray Pin
BlackDice2-Dec-04 7:54
BlackDice2-Dec-04 7:54 
GeneralRe: CStringArray Pin
David Crow2-Dec-04 10:32
David Crow2-Dec-04 10:32 
GeneralRe: CStringArray Pin
Graham Bradshaw2-Dec-04 11:09
Graham Bradshaw2-Dec-04 11:09 
GeneralSubtraction of Integer on Character Array [C++] Pin
Shaitan002-Dec-04 6:49
Shaitan002-Dec-04 6:49 
GeneralRe: Subtraction of Integer on Character Array [C++] Pin
Maximilien2-Dec-04 7:05
Maximilien2-Dec-04 7:05 
GeneralRe: Subtraction of Integer on Character Array [C++] Pin
RChin2-Dec-04 7:11
RChin2-Dec-04 7:11 
GeneralRe: Subtraction of Integer on Character Array [C++] Pin
John R. Shaw2-Dec-04 17:23
John R. Shaw2-Dec-04 17:23 
GeneralScrolling in CRichEditView Pin
zhngmm2-Dec-04 5:46
zhngmm2-Dec-04 5:46 
GeneralExport Outlook Mailboxes programmatically Pin
Kri52-Dec-04 4:55
Kri52-Dec-04 4:55 
GeneralInterrupts & Timers Pin
sweep1232-Dec-04 4:50
sweep1232-Dec-04 4:50 
GeneralRe: Interrupts & Timers Pin
Antony M Kancidrowski2-Dec-04 5:35
Antony M Kancidrowski2-Dec-04 5:35 
GeneralRe: Interrupts & Timers Pin
sweep1232-Dec-04 5:44
sweep1232-Dec-04 5:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.