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


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
#define  COST_PER_CREDT  75      // Cost per credit charged by the
#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

  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

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

       {     Prompt_for_Info();               // Call 1000
              Get_Info (Student,Cnt);          // Call 2000
              Display_Info (Student,Cnt);     // Call 3000
            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
  cout<<"Please enter the students name......................"<< endl;
  cout<<"Please enter the students gender...................."<< endl;
  cout<<"Please enter the students age......................."<< endl;
  cout<<"Please enter the students quality points............"<< endl;
  cout<<"Please enter the students total credits completed..."<< endl;


 } // end 1000

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

  This module will get the information gathered by module 1000.


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

 { // Local Variable

    getline(cin, Student[Loop].Student_Name);
    Student[Loop].Student_Age= getInteger();
    Student[Loop].Student_Quality_Points= getFloat();
    Student[Loop].Student_Credits_Taken= getInteger();

 } // end 2000

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

  This module will call a submodule to do some calculations and display
  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
   cout<<Student[Loop].Student_Name<<" has spent
$"<<Student[Loop].Student_Bill<<" so far on higher education.";
   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++)
                     cout<< "Way to go
                 } // end for
        }// end if

 } // end 3000

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

  This module will calculate the students total tution paid and their


 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_Bill = Student[Loop].Student_Credits_Taken *

 } // 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