Help Compiled vs .exe 
Author Message
 Help Compiled vs .exe

Hello,

I hope someone has a clue what is going on here.  I am starting my
second year of programming and our first project was a rehash of some of
last years stuff.  I wrote the program and it seems to work just fine
except for on thing.  It behaves as it is supposed to when I compile it
and run it right from the IDE.  However when I try to run the .exe the
behavior is different.  The dialogue boxes show up behind the screen but
are still modal.  and when I try to confirm the exit something seems to
get caught in the buffer and the program rushes right through the
confirmation screen and exits rather abruptly.  We are using M$ Visual
C++ 6.0 for the IDE with no service packs (if that makes a difference).
My instructor and I are both stumped.  Any help would be appreciated.

/******************************************************************************

     Program   : checkoff #1
     Programmer   : Robert Cummings
     Location   : MSTC Stevens Point
     Due Date   : Whenever

     Program Description : This program will prove that I
           have not forgotten EVERTHING
           last summer.

************************ Include Files
****************************************/
#define  PROGNAME "Bob's Sample"
#include <stdlib.h>
#include <iostream>
#include <ctype.h>
#include <iomanip>
#include <string>
using namespace std;

#include <myconio.cpp>
#include <center.cpp>
#include <pak.cpp>
#include <header.cpp>
#include <YorN MS.cpp>
#include <max.cpp>
#include <angel.cpp>
#include <dilbert.cpp>
#include <delay.cpp>
#include <Getintgr MS.cpp>
#include <GetFloat MS.cpp>

#define  YES    6                                  // This is needed for
YorN MS
#define  COST_PER_CREDT  75      // Cost per credit charged by the
school
#define  MAXSTUDENTS  20          // Maximum amount of students allowed
to be entered

/*********************** Global Declarations
**********************************/

struct typStudent
     { short Student_Age;                       // What it says
      char Student_Gender;                   // What it says
      string Student_Name;                   // What it says
      float Student_Quality_Points;     // Who knows?
      float Student_Bill;                       // Total tuition costs
      short Student_Credits_Taken;     // What it says
      float GPA ;                                 // Student GPA
     };

/*********************** Prototypes
*******************************************/

 /*1000*/ void Prompt_for_Info (void);
 /*2000*/ void Get_Info (typStudent[],int);
 /*3000*/ void Display_Info (typStudent[],int);
  /*3500*/  void Calculate_Stuff (typStudent[],int);

/********************** Main
Module********************************************

  This module will all the blame or credit for this mess

******************************************************************************/

 int main (void)

 {
  // Local Variables
   int Cnt;
// Counter control variable for the array & loop
   int Response;                                                   //
Answer to "Do you want to enter another student?"
   typStudent Student[MAXSTUDENTS];         // Record of Student
information

   Max();             // Homemade module to get user to maximize the
window
   Angel();           // Splash screen
   Cnt=0;            // Initalize the counter
   cout<<setiosflags(ios::fixed)<<setprecision(2);  // Set format for
output

   do
       {     Prompt_for_Info();               // Call 1000
              Get_Info (Student,Cnt);          // Call 2000
              Display_Info (Student,Cnt);     // Call 3000
            Cnt++;
            Response=YorN2("Do you want to enter another student?");

       }while(Response == YES && Cnt <=MAXSTUDENTS);
   // end loop

   Dilbert();       // Exit screen

   return 0 ;

 } //end main

/********************** 1000 Prompt_for_Info
**********************************

  This module will prompt the user for the information.

******************************************************************************/

 void Prompt_for_Info (void)

 { // Local Variables
  // None

  Header();                     // Homemade header file
  gotoxy(10,10);
  cout<<"Please enter the students name......................"<< endl;
  gotoxy(10,11);
  cout<<"Please enter the students gender...................."<< endl;
  gotoxy(10,12);
  cout<<"Please enter the students age......................."<< endl;
  gotoxy(10,13);
  cout<<"Please enter the students quality points............"<< endl;
  gotoxy(10,14);
  cout<<"Please enter the students total credits completed..."<< endl;

  return;

 } // end 1000

/********************** 2000 Get_Info
*************************************

  This module will get the information gathered by module 1000.

******************************************************************************/

 void Get_Info (typStudent Student[],     // Output-Record of Student
Info
                                     int Loop)             //
Input-Control for the array of Student[]

 { // Local Variable

    gotoxy(62,10);
    getline(cin, Student[Loop].Student_Name);
    gotoxy(62,11);
    Student[Loop].Student_Gender=toupper(getch());
    cout<<Student[Loop].Student_Gender;
    gotoxy(62,12);
    Student[Loop].Student_Age= getInteger();
    gotoxy(62,13);
    Student[Loop].Student_Quality_Points= getFloat();
    gotoxy(62,14);
    Student[Loop].Student_Credits_Taken= getInteger();

    return;
 } // end 2000

/********************** 3000 Display_Info
*************************************

  This module will call a submodule to do some calculations and display
the
  result of the calculations.

******************************************************************************/

 void Display_Info (typStudent Student[],         // Input-Record of
Student Info
                                 int Loop)                         //
Input-Control for the array of Student[]

 { // Local Variables
   int loop;                   // counter for the loop

   Calculate_Stuff (Student,Loop);    // Call 3500
   gotoxy(10,22);
   cout<<Student[Loop].Student_Name<<" has spent
$"<<Student[Loop].Student_Bill<<" so far on higher education.";
   gotoxy(10,23);
   cout<<Student[Loop].Student_Name<<" has a GPA of "<<
Student[Loop].GPA<<" to show for his/her efforts.";
   if (Student[Loop].GPA >= 3.5)  // Just an atta-boy if the student has
good grades
        {
            for(loop = 0; loop <= 11; loop++)
                 {
                     gotoxy(10,24);
                     clreol();
                     Delay(250);
                     gotoxy(10,24);
                     cout<< "Way to go
"<<Student[Loop].Student_Name<<"!!!!!";
                     Delay(250);
                 } // end for
        }// end if
   return;

 } // end 3000

/********************** 3500 Calculate_Stuff
**********************************

  This module will calculate the students total tution paid and their
GPA.

******************************************************************************/

 void Calculate_Stuff (typStudent Student[],  // Input/Output-Record of
Student Info
       int Loop)  // Input-Control for the array of Student[]

 { // Local Variables
  // None

   Student[Loop].GPA = Student[Loop].Student_Quality_Points /
Student[Loop].Student_Credits_Taken;
   Student[Loop].Student_Bill = Student[Loop].Student_Credits_Taken *
COST_PER_CREDT;

   return;
 } // end 3500

/********************** That's all folks
*************************************/



Sun, 02 Mar 2003 05:05:41 GMT  
 Help Compiled vs .exe

gotoxy doesn't work with VC++ 6.0, the code won't compile for sure. Its a
16 bit call not 32 bit. I don't see any routine called for dialogs. This
looks like a console app (MS DOS based) and I'm not sure what you are
referring to as modal dialog. Debug your code and see what is happening,
looking at what you have posted its difficult to say what's happening. If
you are reading from a file ensure that they are in the right directories.



Mon, 03 Mar 2003 00:14:56 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Compile error: Error Spawning Cl.exe or link.exe

2. vcspawn.exe crashes compiling context-sensitive help

3. Help on RC.EXE for compiling 16 bit RES files

4. ATL Exe Vs MFC Exe

5. ATL Exe Vs MFC Exe

6. ATL Exe Vs MFC Exe

7. help with scripts vs. programs (compiled)

8. Help: start win .exe from win .exe

9. HELP!!! cl.exe And bscmake.exe Errors

10. Compiling A Stand-Alone Exe

11. Compiling to Standalone .EXE file!!!!!!!!

12. csc.exe compile options

 

 
Powered by phpBB® Forum Software