Click here to Skip to main content
16,007,814 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralList of lists Pin
16-May-01 23:10
suss16-May-01 23:10 
GeneralRe: List of lists Pin
markkuk16-May-01 23:35
markkuk16-May-01 23:35 
GeneralRe: List of lists Pin
17-May-01 18:41
suss17-May-01 18:41 
QuestionWhy doesn't CStatic keep the size of the icon when using SetIcon? Pin
16-May-01 19:16
suss16-May-01 19:16 
AnswerRe: Why doesn't CStatic keep the size of the icon when using SetIcon? Pin
Peter Godec17-May-01 12:17
Peter Godec17-May-01 12:17 
GeneralRe: Why doesn't CStatic keep the size of the icon when using SetIcon? Pin
18-May-01 0:30
suss18-May-01 0:30 
GeneralRe: Why doesn't CStatic keep the size of the icon when using SetIcon? Pin
Gast12821-Sep-10 4:18
Gast12821-Sep-10 4:18 
QuestionHow do I test CInternetSession::OpenURL() return val Pin
CMFC6.0VS.NETUser16-May-01 18:43
CMFC6.0VS.NETUser16-May-01 18:43 
I am using this code to download a INET File

CFile ofile;
ofile.Open(_T("globe.gif"), CFile::modeWrite | CFile::modeCreate | CFile::typeBinary);
DWORD dread;
BYTE szBuff[1024];
//assumes URL names have been initialized
CInternetSession session("My Session");
CStdioFile* pFile = NULL;
pFile = session.OpenURL(_T("http://..."), 1, INTERNET_FLAG_TRANSFER_BINARY);
while ((dread = pFile->Read(szBuff,1024)) > 0)
{
ofile.Write(szBuff, dread);
}
delete pFile;
session.Close();

This code works alright but I with the code above if my laptop is away from my INET connection there is ASSERT or Exception in CStdioFile::Read() or CStdioFile::Close().

I have used the code below w/ CStdioFile before but w/ the code above CStdioFile::m_pStream seems to always be NULL.

CStdioFile StdioFile;
//use it
if(StdioFile.m_pStream != NULL)
{
FileSaver.Close();
}

So is there a quick way to this the return val of CInternetSession::OpenURL() w/out using TRY/CATCH Blocks or Exceptions. Please these for some reason get the best of me for now.

Thank you...
GeneralTermination handler in MFC/ Pin
Brendan Tregear16-May-01 16:27
Brendan Tregear16-May-01 16:27 
GeneralVB app using VC++ OCX Pin
#realJSOP16-May-01 13:50
professional#realJSOP16-May-01 13:50 
GeneralRe: VB app using VC++ OCX Pin
Dark Angel17-May-01 10:27
Dark Angel17-May-01 10:27 
GeneralRe: VB app using VC++ OCX Pin
Carlos Antollini17-May-01 10:49
Carlos Antollini17-May-01 10:49 
GeneralRe: VB app using VC++ OCX Pin
#realJSOP17-May-01 10:53
professional#realJSOP17-May-01 10:53 
GeneralRe: VB app using VC++ OCX Pin
21-May-01 21:31
suss21-May-01 21:31 
GeneralReading disk directly under Win32 Pin
Wirawan Purwanto16-May-01 13:20
Wirawan Purwanto16-May-01 13:20 
GeneralRe: Reading disk directly under Win32 Pin
Tomasz Sowinski17-May-01 4:51
Tomasz Sowinski17-May-01 4:51 
QuestionDeleting strings from listboxes? Pin
16-May-01 12:40
suss16-May-01 12:40 
AnswerRe: Deleting strings from listboxes? Pin
Christian Graus16-May-01 12:55
protectorChristian Graus16-May-01 12:55 
GeneralRe: can anyone help with code... Pin
16-May-01 12:47
suss16-May-01 12:47 
GeneralRe: can anyone help with code... Pin
#realJSOP17-May-01 2:31
professional#realJSOP17-May-01 2:31 
GeneralRe: can anyone help with code... Pin
#realJSOP17-May-01 4:41
professional#realJSOP17-May-01 4:41 
GeneralRe: can anyone help with code... Pin
Jim A. Johnson17-May-01 5:59
Jim A. Johnson17-May-01 5:59 
GeneralA small hint for posting code in CP's forums Pin
PJ Arends17-May-01 5:22
professionalPJ Arends17-May-01 5:22 
Generalupdating text box in code Pin
16-May-01 10:38
suss16-May-01 10:38 
GeneralRe: updating text box in code Pin
Michael Dunn16-May-01 16:18
sitebuilderMichael Dunn16-May-01 16:18 

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.