Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Console to win app

Console to win app

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialannouncementlearning
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dr eu
    wrote on last edited by
    #1

    Hello ! I am beginner in C++ and i need some help from you ! I want to make my console program into windows application, but I dont now how to do it. Please help me ! Thank you. Boco :confused: //PROGRAM FOR CALCULATING SUM AND AVERAGE OF TWO NUMBERS #include #include int main () { float num_1, num_2; double sum, average; cout << "\n\t\t******************************************* "; cout << "\n\t\t* PROGRAM FOR CALCULATING SUM AND AVERAGE * "; cout << "\n\t\t* OF TWO NUMBERS * "; cout << "\n\t\t* Version 1.0, February, 2004 * "; cout << "\n\t\t******************************************* "; cout << "\n\n\n\n\n Enter first number: "; cin >> num_1; cout << "\n Enter second number: "; cin >> num_2; sum = num_1 + num_2; average = sum / 2.0; cout << "\n\n Calculated sum is: " << sum << endl; cout << "\n Calculated average is: " << average << endl; cout << "\n\n\n\n\n For exit from program press [Enter] >>>>> "; getchar(); return (0); }

    M 1 Reply Last reply
    0
    • D dr eu

      Hello ! I am beginner in C++ and i need some help from you ! I want to make my console program into windows application, but I dont now how to do it. Please help me ! Thank you. Boco :confused: //PROGRAM FOR CALCULATING SUM AND AVERAGE OF TWO NUMBERS #include #include int main () { float num_1, num_2; double sum, average; cout << "\n\t\t******************************************* "; cout << "\n\t\t* PROGRAM FOR CALCULATING SUM AND AVERAGE * "; cout << "\n\t\t* OF TWO NUMBERS * "; cout << "\n\t\t* Version 1.0, February, 2004 * "; cout << "\n\t\t******************************************* "; cout << "\n\n\n\n\n Enter first number: "; cin >> num_1; cout << "\n Enter second number: "; cin >> num_2; sum = num_1 + num_2; average = sum / 2.0; cout << "\n\n Calculated sum is: " << sum << endl; cout << "\n Calculated average is: " << average << endl; cout << "\n\n\n\n\n For exit from program press [Enter] >>>>> "; getchar(); return (0); }

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      Reposting won't get you an answer any faster. A Windows application needs to be structured very differently from a console application. You respond to events from the operating system, rather than driving the process yourself. You need, at the very least, to create a window with suitable controls, then start up a message loop. Frameworks such as MFC can provide a lot of the boilerplate code for you. There isn't space to go into it here, and there are many resources. Try for example Programming Windows by Charles Petzold, Programming Windows with MFC by Jeff Prosise, or for a simpler reference, try Teach Yourself MFC in 24 Hours from SAMS. I would recommend an MFC dialog-based application, with two edit boxes for the two numbers, static controls for the results, and a Calculate button. You would then perform your calculations and show the results in a BN_CLICKED handler for the button. Alternatively you could simply handle EN_CHANGE on both the edit fields and compute the results as the user types. It's up to you.

      D 1 Reply Last reply
      0
      • M Mike Dimmick

        Reposting won't get you an answer any faster. A Windows application needs to be structured very differently from a console application. You respond to events from the operating system, rather than driving the process yourself. You need, at the very least, to create a window with suitable controls, then start up a message loop. Frameworks such as MFC can provide a lot of the boilerplate code for you. There isn't space to go into it here, and there are many resources. Try for example Programming Windows by Charles Petzold, Programming Windows with MFC by Jeff Prosise, or for a simpler reference, try Teach Yourself MFC in 24 Hours from SAMS. I would recommend an MFC dialog-based application, with two edit boxes for the two numbers, static controls for the results, and a Calculate button. You would then perform your calculations and show the results in a BN_CLICKED handler for the button. Alternatively you could simply handle EN_CHANGE on both the edit fields and compute the results as the user types. It's up to you.

        D Offline
        D Offline
        dr eu
        wrote on last edited by
        #3

        Mike, that sounds very havy, do you have maybe same example like my program is ? Boco :confused:

        J 1 Reply Last reply
        0
        • D dr eu

          Mike, that sounds very havy, do you have maybe same example like my program is ? Boco :confused:

          J Offline
          J Offline
          jmkhael
          wrote on last edited by
          #4

          Send me a mail so i can send u the program Papa while (TRUE) Papa.WillLove ( Bebe ) ;

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups