Click here to Skip to main content
15,927,745 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Mail from an NT Service Pin
Nick Blumhardt20-Aug-01 12:51
Nick Blumhardt20-Aug-01 12:51 
GeneralRe: Mail from an NT Service Pin
Nick Blumhardt20-Aug-01 17:38
Nick Blumhardt20-Aug-01 17:38 
GeneralRe: Mail from an NT Service Pin
Giles21-Aug-01 8:53
Giles21-Aug-01 8:53 
GeneralRe: Mail from an NT Service Pin
Nick Blumhardt21-Aug-01 12:41
Nick Blumhardt21-Aug-01 12:41 
Generalpropertysheet: how do I add one to a formview Pin
ssiegel19-Aug-01 18:33
ssiegel19-Aug-01 18:33 
Generalproblems with recreating fwatch Pin
Hong Wye Kean19-Aug-01 17:26
Hong Wye Kean19-Aug-01 17:26 
GeneralRe: problems with recreating fwatch Pin
Michael Dunn19-Aug-01 20:18
sitebuilderMichael Dunn19-Aug-01 20:18 
GeneralProblems with a Win98 Machine Pin
19-Aug-01 15:53
suss19-Aug-01 15:53 
Hello,
I am having problems with this code working on a windows 98 machine.. I have tested it tons of 95, NT and 2000 machines and I have yet to see any problems... but I have one 98 machine that is unable to create the text file.. here is a sample of my code.. can anyone tell me what I might change to get this to work on the 98 machine...

The code goes out to a Internet url and pulls just the htmls' source and dumps it to a text file so I can open it and parse it later etc...

//Operation that goes to the url and pulls the source
CString CUserProfileDlg::GetFile(const char *url, const Char *filename)
{
char httpbuff[HTTPBUFLEN];
TCHAR szCause[2048];
CString Cause;
Cause.Format("YES");

TRY
{
CInternetSession mysession;
CStdioFile *remotefile = mysession.OpenURL(url,1,INTERNET_FLAG_TRANSFER_BINARY|INTERNET_FLAG_RELOAD);

CFile myfile(filename, CFile::modeCreate|CFile::modeWrite|CFile::typeBinary);
int numbytes;

while (numbytes = remotefile->Read(httpbuff, HTTPBUFLEN))
{
myfile.Write(httpbuff, numbytes);
}
}

CATCH_ALL(error)
{
error->GetErrorMessage(szCause,2046,NULL);
Cause.Format("%s",szCause);
}
END_CATCH_ALL;

return (Cause);
}

//Operation of creating the text file
GetFile(strU+strB+strQ, _T("Source.txt")); //grabing html source

//Open the txt file and read it into a member variable
CFile fileEditText;
if(fileEditText.Open(_T("Source.txt"),CFile::modeRead))
{
//Declare a large buffer for reading the text
char cBuf[1024];
UINT uBytesRead;
//Continue reading until no more data is read
while(uBytesRead =
fileEditText.Read(cBuf, sizeof(cBuf)-1))
{
//Null terminate after the last charcter
cBuf[uBytesRead] = NULL;
//add the buffer to the mapped CString
strTime += CString(cBuf);
}
//Close the file
fileEditText.Close();
//Send the string to the variable
UpdateData(FALSE);
}

After that the file should be created.. I then open it and read it into a variable then parse it for values etc....

Any ideas why this doesn't work just on the 98 machine?

Thanks,
Rob Jones
GeneralTesting for Previous Application Instances Pin
19-Aug-01 15:32
suss19-Aug-01 15:32 
GeneralRe: Testing for Previous Application Instances Pin
Ravi Bhavnani19-Aug-01 15:46
professionalRavi Bhavnani19-Aug-01 15:46 
Generalcreating new process sanity check Pin
Amit Jain19-Aug-01 15:30
Amit Jain19-Aug-01 15:30 
GeneralCListCtrl - I just need alittle help Pin
DanYELL19-Aug-01 15:15
DanYELL19-Aug-01 15:15 
GeneralCTreeView / Drawing Question Pin
ArchV19-Aug-01 8:29
ArchV19-Aug-01 8:29 
GeneralRe: CTreeView / Drawing Question Pin
Igor Sukhov19-Aug-01 9:17
Igor Sukhov19-Aug-01 9:17 
GeneralRe: CTreeView / Drawing Question Pin
19-Aug-01 13:41
suss19-Aug-01 13:41 
GeneralRe: CTreeView / Drawing Question Pin
Paolo Messina20-Aug-01 11:57
professionalPaolo Messina20-Aug-01 11:57 
GeneralWord Add-In Pin
AJ12319-Aug-01 2:07
AJ12319-Aug-01 2:07 
GeneralRe: Word Add-In Pin
Michael P Butler19-Aug-01 4:33
Michael P Butler19-Aug-01 4:33 
GeneralWord Add-In Pin
AJ12319-Aug-01 2:06
AJ12319-Aug-01 2:06 
GeneralRe: Word Add-In Pin
Bret Faller20-Aug-01 8:39
Bret Faller20-Aug-01 8:39 
GeneralWeird thread parameter problem Pin
Christian Skovdal Andersen19-Aug-01 0:20
Christian Skovdal Andersen19-Aug-01 0:20 
GeneralRe: Weird thread parameter problem Pin
Focht19-Aug-01 10:58
Focht19-Aug-01 10:58 
GeneralRe: Weird thread parameter problem Pin
loket19-Aug-01 12:36
loket19-Aug-01 12:36 
GeneralRe: Weird thread parameter problem Pin
Christian Skovdal Andersen19-Aug-01 20:13
Christian Skovdal Andersen19-Aug-01 20:13 
GeneralRe: Weird thread parameter problem Pin
Patrick_Kutch19-Aug-01 15:40
Patrick_Kutch19-Aug-01 15:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.