Click here to Skip to main content
15,912,977 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to make an simple weather program which show today's weather to the user.

I want make this program by use VIsual Studio 2008 mfc dialog

I'm new about this part and I need a lot of help.

Could you explain to me how can I make this program as possible as quickly?

Program structure is very simple.

On the dialog, only show EditTextBox ( City's name ) and OK Button

And after I entered name and click 'OK' button, the weather information will show.

thnk.
Posted
Comments
Albert Holguin 1-Nov-11 22:38pm    
What part do you need help on? ...this question is VERY broad... making an MFC application? getting the weather given a city (via web services)?

1. Find website that displays weather data, preferably using the location as a part of the URL.

2. Create test code that will construct the URL from the known site address and the user's input.

3. Write code to download the data located at the calculated URL

4. Inspect manually to determine format of page and appropriate method for extracting the required information.

5. Implement #4 in code

6. Place code from steps 2, 3 & 5 into a single program - Et voila! Weather program.
 
Share this answer
 
Comments
RKS324 2-Nov-11 10:19am    
Lots of weather programs are used zip-code. I want get weather information by only typing city's name not zip-code. How can I implement this? How can I get zip-code from city's name?
enhzflep 2-Nov-11 10:53am    
The first way would be with a zip-code database of some sort in/with your app.
Doesn't seem to really make sense though since it's an on-line app, and can retrieve this info dynamically.

Not sure of an exact url, though I would suspect that there are sites around that will allow you to enter a name in a form before submitting it to receive the result - I.e City Name --> Zip Code. Often this will result in the name entered to be tacked onto the end of a url. E.g - enter "melbourne", url gets constructed as www.UnknownPostcodeRetreivalSite.com/?city=melbourne. You could first query this url then use the returned zip/post code to do another lookup at a weather site.

I've been trying to find it for a little while now, though cannot seem to locate it - I found a weather site that took the city name and put it onto the url This would be one of the easier options.
A (pretty crappy) example of this can be done using google -
E.g http://www.google.com.au/search?q=weather+melbourne
There are lot of web service to get such details. You can use them in your application. Search for such and identify what are the parameters you can control. Then build your UI based on them.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900