| View previous topic :: View next topic |
| Author |
Message |
Robotex Master Cheater
Reputation: 0
Joined: 05 Sep 2006 Posts: 378 Location: The pizza country!
|
Posted: Wed Jul 18, 2007 5:46 am Post subject: [Help]Saving files from net - C++ |
|
|
i'm trying to code a program wich downloads a file from the net, but i'm blocked after i've received the data with recv, on how to save it to a file.. (i know it's a silly question, but i can't find anything on google just some random download pages)
should i create an empty file first then write to it in binary mode or there is an another way?
_________________
ASM/C++ Coder
Project Speranza lead developer |
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Wed Jul 18, 2007 6:48 am Post subject: |
|
|
| you recv it into a buffer, you use createfile and writefile to dump it to a file
|
|
| Back to top |
|
 |
Robotex Master Cheater
Reputation: 0
Joined: 05 Sep 2006 Posts: 378 Location: The pizza country!
|
|
| Back to top |
|
 |
Trow Grandmaster Cheater
Reputation: 2
Joined: 17 Aug 2006 Posts: 957
|
Posted: Fri Jul 20, 2007 3:46 am Post subject: |
|
|
does URLDownloadToFile work in C++?
_________________
Get kidnapped often. |
|
| Back to top |
|
 |
Robotex Master Cheater
Reputation: 0
Joined: 05 Sep 2006 Posts: 378 Location: The pizza country!
|
Posted: Fri Jul 20, 2007 3:58 am Post subject: |
|
|
isn't URLDownloadToFile IE dependant?
_________________
ASM/C++ Coder
Project Speranza lead developer |
|
| Back to top |
|
 |
Trow Grandmaster Cheater
Reputation: 2
Joined: 17 Aug 2006 Posts: 957
|
Posted: Fri Jul 20, 2007 4:02 am Post subject: |
|
|
yes. does anyone now have IE nowadays, e.g. you using windows 95 still or something?
i wouldnt say it is a perfect solution but it seems a lot more straightforward
_________________
Get kidnapped often. |
|
| Back to top |
|
 |
Robotex Master Cheater
Reputation: 0
Joined: 05 Sep 2006 Posts: 378 Location: The pizza country!
|
Posted: Fri Jul 20, 2007 5:21 am Post subject: |
|
|
btw i'm getting
FilesDownloader.cpp urlmon.h: No such file or directory.
and i've already put #include <urlmon.h> and linked to urlmon.lib...
but looks like dev C++ missing the header file
_________________
ASM/C++ Coder
Project Speranza lead developer |
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Fri Jul 20, 2007 9:59 am Post subject: |
|
|
| dev-c++'s header files/libraries are old and smelly. If you want to continue using dev-c++ then download the latest things from the mingw website and replace all your files. otherwise, get a better compiler (or do dynamic linking but that's a temporary solution to a permanent problem).
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Fri Jul 20, 2007 10:21 am Post subject: |
|
|
Dev sucks
go with VC++
can dev even compile something that isnt cmd line?
_________________
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Fri Jul 20, 2007 10:34 am Post subject: |
|
|
| dev doesn't suck, MingW sucks, but most people don't know how/don't bother to set dev up to use a different compiler than MingW.
|
|
| Back to top |
|
 |
Robotex Master Cheater
Reputation: 0
Joined: 05 Sep 2006 Posts: 378 Location: The pizza country!
|
Posted: Fri Jul 20, 2007 11:14 pm Post subject: |
|
|
i'm using dev c++ because i'm connected from an internet point (i'm on holiday) and visual c++ is too big and slow to download :/
_________________
ASM/C++ Coder
Project Speranza lead developer |
|
| Back to top |
|
 |
Trow Grandmaster Cheater
Reputation: 2
Joined: 17 Aug 2006 Posts: 957
|
Posted: Sat Jul 21, 2007 4:25 am Post subject: |
|
|
| Robotex wrote: | | i'm using dev c++ because i'm connected from an internet point (i'm on holiday) and visual c++ is too big and slow to download :/ |
PROGRAMMING on a HOLIDAY?!
yeah ok, maybe its time to relax and do some light coding...=.=
_________________
Get kidnapped often. |
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Sat Jul 21, 2007 4:34 am Post subject: |
|
|
| blland wrote: | | Robotex wrote: | | i'm using dev c++ because i'm connected from an internet point (i'm on holiday) and visual c++ is too big and slow to download :/ |
PROGRAMMING on a HOLIDAY?!
yeah ok, maybe its time to relax and do some light coding...=.= |
Aha, who would program on holiday? Thats a bit.. Strange considering theres many more things you could be doing!
Remember, what you do on holiday stays on holiday!
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Sat Jul 21, 2007 3:23 pm Post subject: |
|
|
| noz3001 wrote: | | blland wrote: | | Robotex wrote: | | i'm using dev c++ because i'm connected from an internet point (i'm on holiday) and visual c++ is too big and slow to download :/ |
PROGRAMMING on a HOLIDAY?!
yeah ok, maybe its time to relax and do some light coding...=.= |
Aha, who would program on holiday? Thats a bit.. Strange considering theres many more things you could be doing!
Remember, what you do on holiday stays on holiday!  |
You keep telling yourself that, maybe your herpes will go away.
|
|
| Back to top |
|
 |
Robotex Master Cheater
Reputation: 0
Joined: 05 Sep 2006 Posts: 378 Location: The pizza country!
|
Posted: Sat Jul 21, 2007 10:40 pm Post subject: |
|
|
well, i'm in a foreign country, i can't speak the local language, and i don't know much the places :/
i haven't got much to do, except homework...
btw updating the windows 32 api headers has deleted getaddrinfo and urlmon is still missing
_________________
ASM/C++ Coder
Project Speranza lead developer |
|
| Back to top |
|
 |
|