InternetReadFile stuffing up downloaded files

R

ree

When I download the files using InternetReadFile, they seem to lose the
formating all the spaces gets removed, and thus I can't open the file.

Here is the file (it a doc fie)
________
ÐÏࡱá




þÿ






¼
___________

Using InternetReadFile it makes the file like this..
___________
ÐÏࡱáapplied to subsequent systems, and is crucial to a software
organization's business strategy.
The Software A...
_____
it removing so much of the formatting

I am saving the internet files like this

____________-
std::string m_strContents1sdp;


if ( hFile2 )
{
CHAR buffersdp1[1024];
DWORD dwReadsdp1;
while ( InternetReadFile( hFile2, buffersdp1, 1023,
&dwReadsdp1 ) )\
{
if ( dwReadsdp1 == 0 )
break;
buffersdp1[dwReadsdp1] = 0;
m_strContents1sdp += buffersdp1;
}
InternetCloseHandle( hFile2 );
}

//outsdp.open(filename.c_str(), ios::eek:ut | ios::binary);
outsdp.open(filename.c_str());


outsdp << m_strContents1sdp << endl;
outsdp.close();


_____________________-
 
T

Thomas Matthews

ree said:
When I download the files using InternetReadFile, they seem to lose the
formating all the spaces gets removed, and thus I can't open the file.

You need to ask in platform specific newsgroup. The C++ standard
language, which is discussed in this newsgroup, does not have any
function named InternetReadFile(). See the FAQ and Welcome.txt
links below for more appropriate newsgroups.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top