|
I writing some application that use CFtpConnection to download some files from some ftp server.
This part of my code is base on some Do..While loop that try to download one or more file(s) and after the download the do..while loop stop.
I found out that in case that the ip address that i try to connect ( the ftp server ) is not exist or not valid than i have infinite loop in the do..while.
I don't know how can i check if the ip address is valid.
I don't know if i can check if my connection is success or if i even have any access to the ftp server.
I don't know how to solve this problem.
Thanks for any help.
|
|
|
|
|
I guess the CFtpConnection has methods returning failure or success.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes,
But for some reason i get back this connection as success and not failure.
|
|
|
|
|
Supposing the connection returning OK, what about the GetFile method?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
How can it be a successful connection with an invalid IP address?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
check every return code of failure or at last you can work with a timeout.
Greetings from Germany
|
|
|
|
|
How can i define Time out to the ftp connection in this case ?
|
|
|
|
|
You must take a start time before doing ftp and compare it with the actual time after some ftp action.
But i cannot believe that you get no error code. Please post the ftp in the first/original/root message
Greetings from Germany
|
|
|
|
|
Post your code!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
I am trying to find out the width of data that is writtern in unicode.Is there any API for this.
I find GetTextMetrices but it does not give me correct width for unicode true type font.
Thanks in Advance
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Check that all is written in Unicode. Maybe you havent supported the font name properly
Some code to look at it would be nice.
Greetings from Germany
|
|
|
|
|
Shilpi Boosar wrote: I find GetTextMetrices but it does not give me correct width for unicode true type font.
How are you using it?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
If GetTextMetrics does not return the proper width, which it does not for some fonts such as ALISON, then one should use the GetCharABCWidthsFloat function.
RECT ImageRect = {0};
TEXTMETRIC tm = {0};
GetTextMetrics(ImageDC, &tm);
ImageRect.bottom = tm.tmHeight;
ABCFLOAT ABCWidths = {0};
double left = 0.0;
double right = 0.0;
double pos = 0.0;
for (std::tstring::iterator it = ImageText.begin(); it != ImageText.end(); ++it)
{
if (GetCharABCWidthsFloat(ImageDC, *(it), *(it), &ABCWidths))
{
pos += ABCWidths.abcfA;
left = min(left, pos);
pos += ABCWidths.abcfB;
right = max(right, pos);
pos += ABCWidths.abcfC;
}
}
ImageRect.right = (long)((right - left) + 0.5);
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
|
After intalling "WindowsXP-KB918997-v6-x86-ENU.exe" ,whenever I am building my project,it is showing error "CanNot open include file "winsock2.h"".But the file winsock2.h is there in my system and I have also included the correc path.What could be the reason?Can anybody help?
|
|
|
|
|
an89 wrote: I have also included the correc path
How did you specify that? I.e. have you set properly the include search path of Visual Studio ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes I have included proper path in visual studio.Still,its giving same error.
|
|
|
|
|
Hi,
I am working on an MFC Application in which there is chat option with sending emoticons/smiley features.
I am having the codes for each emoticons. When the emoticons button is clicked i want its code to de added in the EditBox.
Now the problem i am facing that I am unable to put the code of smiley at the cursor position. Rather I am able to put it either at the begining of the text or at the end of the text.
please help me.
Thanks In Advance.
Dhiraj Kumar Saini
modified on Monday, October 27, 2008 5:35 AM
|
|
|
|
|
Dhiraj kumar Saini wrote: ...I am unable to put the code of smiley at the cursor position.
How are you obtaining such?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
when i pass value for the sfo.pFrom="d:\\Test\\*.txt\0" it delete the file. But i dont know where my software will install. I have also used to get the path by "GetModuleFileName (hMod, szName, sizeof(szName))" and it return the path like "D:\OHWR\ISS\something.exe". After that i add double slash and kept the path in a variable like "D:\\OHWR\ISS\\*.txt\0". When i used the variable in "sfo.pFrom=3rd variable" It not works.
My code are given below. I am trying it from last week. i have post this msg several time.
---------------------------------
char true_path[100];
//returns the path where .exe install---------
TCHAR szName [MAX_PATH];
HMODULE hMod = GetModuleHandle (NULL);
GetModuleFileName (hMod, szName, sizeof(szName));
Return_Path(true_path, szName); //returns the path with double slash like "D:\\Test\\*.txt\0"
//Remove the files from specified Foleder-------------------
SHFILEOPSTRUCT sfo;
sfo.pTo = NULL;
sfo.hwnd = NULL;
sfo.wFunc = FO_DELETE;
sfo.pFrom = true_path;
sfo.fFlags = FOF_FILESONLY | FOF_NOERRORUI | FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI;
SHFileOperation(&sfo);
|
|
|
|
|
double backslash is a bug if it is already a string variable!!!
or maybe the "*" in the filepath isnt such a good a idea
Greetings from Germany
|
|
|
|
|
Sk Mohiuddin wrote: After that i add double slash...
Why? It's not necessary, and may even lead to problems.
Sk Mohiuddin wrote: ...It not works.
Is this supposed to be a helpful description?
Sk Mohiuddin wrote: i have post this msg several time.
And you have yet to answer any questions.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
i need convert file GIF to file BMP. please guide.
guide for me struct file GIF.thanks very much.
|
|
|
|
|
have you looked at CImage (MFC class)? I believe it provides what you need...
|
|
|
|
|