|
Here is one solution from MSDN.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.asp
Kuphryn
|
|
|
|
|
Hi,
I have implemented an FTP application, which will schedule itself to run daily by using SetTimer, once it’s started. Everyday it will FTP-get a plain text file from a remote server using MFC classes CInternetSession and CFtpConnection.
The plain text file’s name will be the same, but the content is updated daily. The problem I’m having is the first time I start the application, it gets the text file of that day, but then it will get the same file, even though the content of the remote file has already been updated. It seems like the file is cached somewhere. If I stop the application and re-start it, again it will be fine the first time.
The code is below:
CInternetSession session(_T("DBAdmin"));
CFtpConnection* ftp;
session.SetOption (INTERNET_OPTION_CONNECT_TIMEOUT, 30000);
session.SetOption (INTERNET_OPTION_CONTROL_SEND_TIMEOUT, 30000);
session.SetOption (INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT, 30000);
session.SetOption (INTERNET_OPTION_DATA_SEND_TIMEOUT, 30000);
session.SetOption (INTERNET_OPTION_DATA_RECEIVE_TIMEOUT, 30000);
try
{
ftp = session.GetFtpConnection (strIP, strLogin, strPwd, iPort);
if (ftp)
{
if (!ftp->GetFile (strSrc + strFileName, strDest + strFileName))
}
}
Is this a setting problem or a programming one?
Thanks in advance.
Tony
|
|
|
|
|
I suspect there is a problem on the server side. The server may not be updating its data relative to the actual file. In other words, the server is no aware that the file has changed.
Kuphryn
|
|
|
|
|
When you construct the CInternetSession object, pass the flag INTERNET_FLAG_DONT_CACHE as the Flags parameter:
CInternetSession session(_T("DBAdmin"), 1, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, INTERNET_FLAG_DONT_CACHE);
|
|
|
|
|
I just downloaded SP5 from msdn and I choose the multi-part download. So I have 11 files numbered 1 to 11 this is the SP5 core, no problem with those.
There are aslo 3 files called vs6sp5s1.exe, vs6sp5s2.exe and vs6sp5s3.exe. When I unpack them they are full of headers, .lib and so. I don't know how to install those files, should I unzip them in the same folder as the SP5 core. It seems odd to me as SP5 is mainly composed of CAB files when the 3 others are a bit messy.
Any info someone ?
Thnak in advance
Yarp
http://www.senosoft.com/
|
|
|
|
|
Just for yor information, you need to unzip all files into one folder and then run the Setup.exe that came with the 1st cab file.
|
|
|
|
|
Thanks for the answer
Now, I will proceed.
Yarp
http://www.senosoft.com/
|
|
|
|
|
Hi guys
I've read the following optimizations switches
/G5 Optimizes for Pentium processor.
/G6 Optimizes for Pentium Pro processor.
But exists some newer switches to optimize for Pentium III or Pentium 4 processors?
Best Regards
Dr.Pi
|
|
|
|
|
|
I'm downloading.
I have some questions.
What happen if you run this code in an AMD processor?
Best regards
Dr.Pi
|
|
|
|
|
How to check if bit STORE_RTF_OK is set in message store provider?
|
|
|
|
|
Call the message store's GetProps() method to retrieve the PR_STORE_SUPPORT_MASK property. Then check the STORE_RTF_OK bit.
|
|
|
|
|
if ((pPropVal->Value.l & STORE_UNCOMPRESSED_RTF) == STORE_UNCOMPRESSED_RTF)
will get it.
|
|
|
|
|
Which is incorrect. The expression (pPropVal->Value.l && STORE_UNCOMPRESSED_RTF) evaluates to 1 so of course the whole condition is TRUE. To AND two values, you need to use the '&' operator.
|
|
|
|
|
Have you tried printing the hex value of pPropVal->Value.l ? It'll show you what bits are set and what bits aren't.
|
|
|
|
|
dec: 145405
hex: 237FD
bin: 10 0011 0111 1111 1101
|
|
|
|
|
100011011111111101 (0x237FD)
& 001000000000000000 (STORE_UNCOMPRESSED_RTF)
====================
000000000000000000
100011011111111101 (0x237FD)
& 000000100000000000 (STORE_RTF_OK)
====================
000000000000000000
|
|
|
|
|
|
I am permanently logging lines of text with a "\r\n" at the end to a CRichEditCtrl. That way, the CRichEdit appends a new line of text with every call of ReplaceSel("SomeText\r\n") and keeps scrolling down. Stupidly the whole thing gets very sluggish as the amount of text increases. I saw applications doing this kind of "logging" for several hours without getting slower. Does anybody have an idea how to do this ???
MS
|
|
|
|
|
I use a listbox and add lines to the end of the list.
John
|
|
|
|
|
I have a problem I have been scratching my head on for a few hours now. I have a class in a project which has not changed in 6 months, but when I came to build the whole project this morning I got about 22 errors in it to do with some friend functions for serialzation trying to access a protected member variable.
#ifdef _DEBUG
friend CDumpContext& AFXAPI operator<<(CDumpContext& dc, CGoodTime time);
#endif
friend CArchive& AFXAPI operator<<(CArchive& ar, CGoodTime time);
friend CArchive& AFXAPI operator>>(CArchive& ar, CGoodTime& rtime);
#pragma message(" GoodTime.h")
protected:
void SetDays( tm *ptm );
private:
tm m_time;
};
The actual implemenations of these functions throw up the compile errors. Now I have added in a #pragma message command to make sure the correct header is being used, and it is. So the next thing I tried was the compiler /P option to get a copy of the output that goes into the compiler, needless to say with the /P option it compiles without any problems, remove /P and they come back.
Any ideas why this should be so?
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Roger Allen wrote:
...with the /P option it compiles without any problems, remove /P and they come back. Which is to be expected, as the /P switch does not do any compiling, but just sends the preprocessor output to a file.
I know this does not solve your problem, but I just wanted to clarify in case you were expecting something that was not meant to happen.
|
|
|
|
|
DavidCrow wrote:
the /P switch does not do any compiling, but just sends the preprocessor output to a file.
OK, that explains one thing. The docs don't say that /P stops the compiler form compiling.
Anyway, I have done some more tests here and the project builds on a different PC with teh same VC version etc, so it seems to be down to some local configuration setting.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Roger Allen wrote:
The docs don't say that /P stops the compiler form compiling.
Actually, the documentation clearly states that this option suppresses compilation.
|
|
|
|
|
DavidCrow wrote:
Actually, the documentation clearly states that this option suppresses compilation.
Well, my docs in this case was not the MSDN, but John Robbins:Debugging applications. I remebered reading about the switch and looked it up there. Needless to say he has a slight cut down version of the info in his book.
Just means I need to check in all the sources available. Anyway, I have tracked the problem down to an include file causing the problem, not sure what part of it yet.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|