KukiPei
asked on
How to change Working offline to working online
Hi to all.
I'm working on some application with Visual C++.
I need to download file from ftp server.
I'm using this code:
"
CInternetSession mysession;
CFtpConnection* pFtpConn = mysession.GetFtpConnection ("ftp server", "username", "password");
pFtpConn->GetFile("name of the file", "name of the file", FALSE))
"
Everything works fine when "Work offline" in Internet explorer is unchecked. (File->Work offline in IE).
but when work offline is checked it does't work.
Can I change work offline to work online from my application and how.
I hope you understand my quastion.
Thanks in advance.
I'm working on some application with Visual C++.
I need to download file from ftp server.
I'm using this code:
"
CInternetSession mysession;
CFtpConnection* pFtpConn = mysession.GetFtpConnection
pFtpConn->GetFile("name of the file", "name of the file", FALSE))
"
Everything works fine when "Work offline" in Internet explorer is unchecked. (File->Work offline in IE).
but when work offline is checked it does't work.
Can I change work offline to work online from my application and how.
I hope you understand my quastion.
Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also you can try with CInternetConnection::SetOp tion() function member with INTERNET_OPTION_IGNORE_OFF LINE flag.
It will work with IE5 - IE6 only
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_cinternetsession.3a3a.setoption.asp
It will work with IE5 - IE6 only
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_cinternetsession.3a3a.setoption.asp
ASKER
I tryed
InternetCheckConnection(NU LL,FLAG_IC C_FORCE_CO NNECTION,0 );
but it doesn't work.
Also I tryed INTERNET_OPTION_IGNORE_OFF LINE
code:
CInternetSession mysession;
mysession.SetOption(INTERN ET_OPTION_ IGNORE_OFF LINE, 1);
but it gives me an error message:
error C2065: 'INTERNET_OPTION_IGNORE_OF FLINE' : undeclared identifier
I'm using Visual c++ 6.0
OS Windows 2000
IE 6
I included "wininet.h" and link Wininet.lib
InternetCheckConnection(NU
but it doesn't work.
Also I tryed INTERNET_OPTION_IGNORE_OFF
code:
CInternetSession mysession;
mysession.SetOption(INTERN
but it gives me an error message:
error C2065: 'INTERNET_OPTION_IGNORE_OF
I'm using Visual c++ 6.0
OS Windows 2000
IE 6
I included "wininet.h" and link Wininet.lib
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Now I don't have any error messages, but when I start application I get
Debug Assertion Failed!
dialog with abort , retry, ignore.
Maybe I'm using CInternetSession::SetOptio n() wrong.
code is the same:
CInternetSession mysession;
mysession.SetOption(INTERN ET_OPTION_ IGNORE_OFF LINE, 1);
Thanks for trying to help me.
Debug Assertion Failed!
dialog with abort , retry, ignore.
Maybe I'm using CInternetSession::SetOptio
code is the same:
CInternetSession mysession;
mysession.SetOption(INTERN
Thanks for trying to help me.
http://msdn.microsoft.com/library/en-us/wininet/wininet/internetcheckconnection.asp
Notice you have to include "wininet.h" and must link Wininet.lib
You can use it as:
InternetCheckConnection(NU