home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

My first application, try and suggest..

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2336
Discussions: 200,993, Posts: 2,379,924, Members: 246,362
Old September 24th, 2004, 06:17 PM   Digg it!   #1 (permalink)
Senior Member
 
TechKnickle's Avatar
 
Join Date: Aug 2004
Location: LA, California
Posts: 812
Send a message via AIM to TechKnickle Send a message via MSN to TechKnickle
My first application, try and suggest..

It's so exciting, creating your first executable file. I made this program after teaching myself C++ basics. It is a simple application that took me about 10 minutes to write and about 10 more minutes to figure out why it wasn't working. I still couldn't figure out how to make it close out right, but you can just close it by clicking the cancel button. Now... How do I make a GUI for it? Anybody have any suggestions?

Here is the link if you would like to try my app. It is just a simple program that converts the temperature in Celsius (C) to Fahrenheit (F). Thanks

Here is the link.

http://techknickle.tripod.com/thepicture.htm
__________________
People are like coins, there's always two sides.

Last edited by TechKnickle : September 24th, 2004 at 06:21 PM. Reason: added link
TechKnickle is offline   Reply With Quote
Old September 24th, 2004, 06:23 PM     #2 (permalink)
Not Really a Member
 
Join Date: Oct 2001
Posts: 25,401
You should post up the source, so people get a little better of a feeling that they can trust it even if it doesn't make much sense to them.

Congrats
To get a GUI in winders your best bet is to get something like Visual C++
Not technically required, but takes out a LOT of the BS, its rather painful to write C++ guis by hand.
__________________
Helicopters don't fly; they vibrate so much and make so much noise that the earth rejects them.
vass0922 is online now   Reply With Quote
Old September 24th, 2004, 06:27 PM     #3 (permalink)
Senior Member
 
TechKnickle's Avatar
 
Join Date: Aug 2004
Location: LA, California
Posts: 812
Send a message via AIM to TechKnickle Send a message via MSN to TechKnickle
Yea I was looking at Visual C++ but that costs a ton of money. I will just save up and get it eventually, I have seen that program before and have heard that it was the best for doing what I am looking to do. I had that program on my site last night, I will post the source at about 3:00 (The time I get home) so that you all can see it. Thanks again

~Tech
TechKnickle is offline   Reply With Quote
Old September 24th, 2004, 06:28 PM     #4 (permalink)
I am a banana!
 
originel's Avatar
 
Join Date: Jun 2002
Location: Texas Tech
Posts: 3,921
Send a message via AIM to originel
When you say visual c++, do you mean mfc?

here's a little clarification, visual c++ is just microsofts brand of c++, which is just normal c++ that comes with all of microsofts libraries, namely mfc and .net. If you can get the libraries (which isn't hard) borland and even cygwin (i think) can do everything visual c can. MFC is short for microsoft foundation classes and is basically a wrapper around the win32 API, which is the set of calls you make to do GUIs in windows. It is fairly complex with a very steep learning curve, but once you learn it it's actually very straightforward IMO. i like it better than MFC.

but i digress...if you want a GUI at your level you should just stick to visual basic or visual c#. doing GUIs in c++ is very difficult for a beginner. if you still want to try though, go to devcentral.iftech.com. they have some very good tutorials. you have to register, but it's free and i've never gotten any spam from them (or any e-mail at all for that matter).

Last edited by originel : September 24th, 2004 at 06:31 PM.
originel is offline   Reply With Quote
Old September 24th, 2004, 06:56 PM     #5 (permalink)
Senior Member
 
TechKnickle's Avatar
 
Join Date: Aug 2004
Location: LA, California
Posts: 812
Send a message via AIM to TechKnickle Send a message via MSN to TechKnickle
Cool, thanks Originel. I had that idea, and it really does look complicated, but I am determined and i do learn fast. Below is my source:

Code:
//
//Conversion Celsius to Fahrenheit by *ME (Name sensored for my privacy)
//

#include <iostream.h>
#include <stdio.h>
int main(int nNumberofArgs, char* pszArgs[])
{
    //first statement
    int nCelsius;
    
    cout <<"Enter the temperature in Celsius:";
    cin >> nCelsius;
    
    int nFactor;
    nFactor = 212 - 32;
    
    int nFahrenheit;
    nFahrenheit = nFactor * nCelsius/100 + 32;
    
    //results
    cout << "Fahrenheit value is:";
    cout << nFahrenheit;
    cin >> nCelsius;
}
TechKnickle is offline   Reply With Quote
Old September 24th, 2004, 07:03 PM     #6 (permalink)
Ultimate Member
 
Tekk's Avatar
 
Join Date: Oct 2001
Location: Pasadena, CA
Posts: 2,177
Quote:
Originally Posted by vass0922
You should post up the source, so people get a little better of a feeling that they can trust it even if it doesn't make much sense to them.

Congrats
To get a GUI in winders your best bet is to get something like Visual C++
Not technically required, but takes out a LOT of the BS, its rather painful to write C++ guis by hand.


If its anything like writing Java GUI's then look out Getting all the grid-layouts and button placements in my simple 1 form java app was ridiculously tedious.
__________________
YAH! I knew you'd be jealous
Tekk is offline   Reply With Quote
Old September 24th, 2004, 07:28 PM     #7 (permalink)
may contain mild peril
 
SpookyEddy's Avatar
 
Join Date: Oct 2001
Location: UK
Posts: 3,329
I am don't write much C++ but a few things spring to mind...
Code:
#include <iostream>   // no need for the .h in C++

int main()
{
  float tempCel;

  std::cout << "Enter the temperature in Celsius: ";
  std::cin  >> tempCel;

  float tempFar = (1.8 * tempCel) + 32; // can't remember if this is correct

  std::cout << "Fahrenheit value is: ";
  std::cout <<  tempFar << std::endl;

  return 0;   // main should return an int
}
I am sure some of the C++ guys can chime in and add something more useful

Regards

ed
SpookyEddy is offline   Reply With Quote
Old September 24th, 2004, 08:13 PM     #8 (permalink)
Member
 
Join Date: Jan 2004
Posts: 242
yea i dont think the header needs the .h unless you wrote that library and it would have " " instead of < >.
this is how i had to write the header on some basic c++ but it was using unix...dunno how different the code would be.

#include<iostream>
#include<string>
#include<cstdlib> //provides EXIT_SUCCESS
using namespace std;
int main(){
...
...
return EXIT_SUCCESS;
}

i think that the "EXIT_SUCCESS" should exit the program correctly
engineuity is offline   Reply With Quote
Old September 24th, 2004, 08:45 PM     #9 (permalink)
Senior Member
 
TechKnickle's Avatar
 
Join Date: Aug 2004
Location: LA, California
Posts: 812
Send a message via AIM to TechKnickle Send a message via MSN to TechKnickle
Ok thank's for the input. I wasn't sure if I had to include .h for my header files, but now I know

I was going to put in some floating point characters to make the output more accurate.

How can I loop it? LIke if they want another number to be entered how do I go back to my first cin?

Also, I made it close correctly by removing the last line asking for the cin again and putting a

return 0;

there instead

Last edited by TechKnickle : September 24th, 2004 at 08:50 PM.
TechKnickle is offline   Reply With Quote
Old September 24th, 2004, 08:49 PM     #10 (permalink)
Member
 
Join Date: Jul 2004
Location: Batavia, Ohio, USA
Posts: 35
Send a message via MSN to Nightfire
If you wanna loop it, you have to start a loop, put the code there, check to see if the first number equals a certain number wanting to exit, if not, continue.

From using SpookyEddy's code, it's something like this:

Code:
#include <iostream>   // no need for the .h in C++

int main()
{
   int a = 0;

   while ( a == 0 ) //beginning never-ending loop
   {
      float tempCel;

      std::cout << "Enter the temperature in Celsius: ";
      std::cin  >> tempCel;

      if ( tempCel == 0 )
      {
         return 0;
      }

      float tempFar = (1.8 * tempCel) + 32; // can't remember if this is correct

      std::cout << "Fahrenheit value is: ";
      std::cout <<  tempFar << std::endl;
   }

   return 0;   // main should return an int
}

Last edited by Nightfire : September 24th, 2004 at 08:56 PM.
Nightfire is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
runnig win16 applications under 2000/XP mahooch Applications and Operating Systems 1 June 9th, 2004 09:33 PM
opening port on firewall question lunar Networking and Internet 5 September 16th, 2003 09:36 PM
laptop upgrade cymru General Tech Discussion 4 November 25th, 2002 05:15 AM
VB Desktop Application Accessing SQL Server on Web Server imd Webmastering and Programming 1 October 24th, 2002 02:21 PM
VB.NET vass0922 Webmastering and Programming 8 September 9th, 2002 12:31 AM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (3088)
Foxconn Blackops x48 MoBo (5)
Charges against non-tippers dropped.. (20)
Health Care Rationing (16)
Delete an OS (17)
Nvidia GTX 260 problem (12)
Laptop with wireless problem. (12)
Wireless Televisions. (12)
windows vista security holes (19)
CPU fan stops spinning randomly (11)
Regular Build (11)
[F@H SPAM 11/16/09] ! 1/2 months to.. (41)
Point and Shoot Camera Suggestions. (8)
windows 7 problem (7)
Recent Discussions
Is the PSU I received dead? (16)
FreeAgent drive software not x64 comp.. (1)
Intel 5100 AGN issues fixed yet? (28)
Nvidia GTX 260 problem (12)
Foxconn Blackops x48 MoBo (5)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (41)
Print spooler problem (17)
Q9650 vs. Q9550 (2)
Desktop Calendar Application (2)
Looking for new motherboard (1)
soundmon.exe (8)
Jedi Academy Problem (3)
Can a page file be "too big".. (1)
Point and Shoot Camera Suggestions. (8)
Size after cutting 700Mb file is 2.5 .. (0)
Delete an OS (17)
windows vista security holes (19)
updating BIOS via winflash, claims fi.. (1)
New Server Configuration Suggestions (0)
cheap gaming laptop? (12)
Unallocated Space (2)
help me pls laptop just stopped worki.. (1)
C# + LINQ Help (7)
Dynex DX E-402 (3)
EVGA 9800 gtx help with finding a goo.. (12)


All times are GMT -4. The time now is 10:48 AM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28