Nathan Strandberg
April 29th, 1999, 07:01 PM
I got the listbox to display the text, but it adds it after the download is completed. How can I get it to do it as the gets the command?
Heres my code:
GetDlgItem(IDOK)-> EnableWindow(FALSE);
CInternetSession* m_Net;
CFtpConnection* m_Ftp;
m_Status.AddString("> Connecting to the internet");
GetDlgItem(IDC_CONNECTTEXT)-> EnableWindow(TRUE);
m_Net = new CInternetSession();
m_Status.AddString("> Connected");
if (!m_Net)
{
m_Status.AddString("> Could not establish connection");
AfxMessageBox("Could not establish connection", MB_OK);
m_Status.AddString("> I'm Disconnecting now!");
m_Net->Close();
m_Status.AddString("> I'm Disconnected!");
m_Status.AddString("> Please try again");
GetDlgItem(IDOK)-> EnableWindow(TRUE);
return;
}
m_Status.AddString("> Connecting to ftp.download.com");
m_Ftp = m_Net->GetFtpConnection(CString("ftp.microsoft.com"));
m_Status.AddString("> Done");
if (!m_Ftp)
{
m_Status.AddString("> Could not connect to FTP");
AfxMessageBox("Could not connect to %s");
m_Status.AddString("> I'm Disconnecting now!");
m_Ftp->Close();
m_Net->Close();
m_Status.AddString("> I'm Disconnected!");
m_Status.AddString("> Please try again");
GetDlgItem(IDOK)-> EnableWindow(TRUE);
return;
}
GetDlgItem(IDC_CONNECTTEXT)-> EnableWindow(FALSE);
GetDlgItem(IDC_DOWNLOADTEXT)-> EnableWindow(TRUE);
m_Status.AddString("> Am I your friend?");
m_Status.AddString("> Downloading to get you back on the road again!");
m_Ftp->GetFile(CString("DISCLAIM.TXT"),
CString("txt.txt"));
m_Ftp->GetFile(CString("dirmap.txt"),
CString("dirmap.txt"));
m_Status.AddString("> Done");
GetDlgItem(IDC_DOWNLOADTEXT)-> EnableWindow(FALSE);
GetDlgItem(IDC_CLOSETEXT)-> EnableWindow(TRUE);
m_Status.AddString("> Be free FTP, be freeeeeee!");
m_Ftp->Close();
m_Status.AddString("> Done");
m_Status.AddString("> Damm net! Leave me alone!");
m_Net->Close();
GetDlgItem(IDC_CLOSETEXT)-> EnableWindow(FALSE);
m_Status.AddString("> Done");
m_Status.AddString("> Am I still your friend?");
m_Status.AddString("> No errors detected!");
m_Status.AddString("> Though I found about 2000 virus!");
m_Status.AddString("> Process complete friend");
MessageBox("Download of your Dira product is complete!");
GetDlgItem(IDOK)-> EnableWindow(TRUE);
Heres my code:
GetDlgItem(IDOK)-> EnableWindow(FALSE);
CInternetSession* m_Net;
CFtpConnection* m_Ftp;
m_Status.AddString("> Connecting to the internet");
GetDlgItem(IDC_CONNECTTEXT)-> EnableWindow(TRUE);
m_Net = new CInternetSession();
m_Status.AddString("> Connected");
if (!m_Net)
{
m_Status.AddString("> Could not establish connection");
AfxMessageBox("Could not establish connection", MB_OK);
m_Status.AddString("> I'm Disconnecting now!");
m_Net->Close();
m_Status.AddString("> I'm Disconnected!");
m_Status.AddString("> Please try again");
GetDlgItem(IDOK)-> EnableWindow(TRUE);
return;
}
m_Status.AddString("> Connecting to ftp.download.com");
m_Ftp = m_Net->GetFtpConnection(CString("ftp.microsoft.com"));
m_Status.AddString("> Done");
if (!m_Ftp)
{
m_Status.AddString("> Could not connect to FTP");
AfxMessageBox("Could not connect to %s");
m_Status.AddString("> I'm Disconnecting now!");
m_Ftp->Close();
m_Net->Close();
m_Status.AddString("> I'm Disconnected!");
m_Status.AddString("> Please try again");
GetDlgItem(IDOK)-> EnableWindow(TRUE);
return;
}
GetDlgItem(IDC_CONNECTTEXT)-> EnableWindow(FALSE);
GetDlgItem(IDC_DOWNLOADTEXT)-> EnableWindow(TRUE);
m_Status.AddString("> Am I your friend?");
m_Status.AddString("> Downloading to get you back on the road again!");
m_Ftp->GetFile(CString("DISCLAIM.TXT"),
CString("txt.txt"));
m_Ftp->GetFile(CString("dirmap.txt"),
CString("dirmap.txt"));
m_Status.AddString("> Done");
GetDlgItem(IDC_DOWNLOADTEXT)-> EnableWindow(FALSE);
GetDlgItem(IDC_CLOSETEXT)-> EnableWindow(TRUE);
m_Status.AddString("> Be free FTP, be freeeeeee!");
m_Ftp->Close();
m_Status.AddString("> Done");
m_Status.AddString("> Damm net! Leave me alone!");
m_Net->Close();
GetDlgItem(IDC_CLOSETEXT)-> EnableWindow(FALSE);
m_Status.AddString("> Done");
m_Status.AddString("> Am I still your friend?");
m_Status.AddString("> No errors detected!");
m_Status.AddString("> Though I found about 2000 virus!");
m_Status.AddString("> Process complete friend");
MessageBox("Download of your Dira product is complete!");
GetDlgItem(IDOK)-> EnableWindow(TRUE);