
December 7th, 2002, 07:39 AM
|
|
|
|
Join Date: Apr 2007
Location: NC
Posts: 21
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
C++ problems with files
I know this is all web stuff here...but no one seems to know....
File.Open(RFile, CFile::shareDenyNone | CFile::typeBinary, &pError)
UINT nRead;
nRead = File.Read(FileData, 8192);
while (nRead == 8192){
AllData.Format("%s", FileData);
send(work, AllData, 8192, 0);
nRead = File.Read(FileData, nRead);
}
if( nRead > 0 ){
AllData.Format("%s", FileData);
send(work, AllData, nRead, 0);
}
With the above code I can open text files fine, but if I try to open anything else(gif, jpg, zip, etc.) and send the data through the socks the data is all messed up...
I think it is because the CString terminating at the NULLs in the file but im not sure...Anyone know how to fix this problem?
|