|
Hi to all.
If anyone know how to get IP address from host name?
I need to establish FTP connection to web server, and I have URL string, from witch I get host name or IP addres (http://111.11.11.111/... or http://host_name/...). Next I need to find out if it is a IP address or host name (I can do that easily by checking for 3 '.' character, or there is a better or safer way?). If it is a host name I need to get IP address from it so I can make FTP connect!?
Thanks for help in advance.
|
|
|
|
|
|
use the API gethostbyname to get the IP
|
|
|
|
|
I know that!
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.
[my articles]
|
|
|
|
|
It was for more emphasised!
|
|
|
|
|
Thanks for yours replay!
Can I ask for another help.
I connect to web server using FTP and I can't remove dir becauce it is not empty. So I need to loop trough dir and delete all files before?
How I can do that. So far I used CFtpConnection and methods like 'GetCurrentDirectory', 'SetCurrentDirectory' and 'RemoveDirectory'(which returned error saying dir is not empty).
Thanks!
|
|
|
|
|
josip cagalj wrote: So I need to loop trough dir and delete all files before?
Yes. Use CFtpFileFind for this.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I think the following code will help u.
sockaddr_in pAddrTo = (struct sockaddr_in *)&whereto;
memset(pAddrTo,0,sizeof(sockaddr_in));
pAddrTo->sin_family = AF_INET;
pAddrTo->sin_addr.s_addr = inet_addr(m_szDestinationIp);
pAddrTo->sin_port = 0;
if(pAddrTo->sin_addr.s_addr != (unsigned)-1)
{
strcpy(szHostName, m_szDestinationIp);
}
else
{
hp = gethostbyname(m_szDestinationIp);
if (hp)
{
pAddrTo->sin_family = hp->h_addrtype;
memcpy(&pAddrTo->sin_addr.s_addr,hp->h_addr_list[0], hp->h_length);
strcpy(szHostName, hp->h_name);
}
else
{
sprintf(szPingResult,"unknown host %s\n", m_szDestinationIp);
ClosePing();
return szPingResult;
}
}
|
|
|
|
|
Hyperlink text inside balloon tooltip for a taskbar icon and getting the click events of hyperlink. If anybody have experience please help me
Thanks
|
|
|
|
|
This doesn't sound like a Tooltip. This is more like a popup menu or window. It also sounds like you would get into a rather annoying state where the user would be trying to "chase" the hyperlink in the tooltip window before the tooltip window disappeared. If you code a tooltip around that to keep the tooltip window visible until you get off it then you have the problem of access to the screen region under the tooltip.
I would suggest two CP classes: the CXHyperLink class by Hans Dietrich and the CTitleMenu class by Arthur Westerman.
|
|
|
|
|
i know how i do disable "incremental linking" in VC project, but
how do i disable "incremental linking" in my delphi project?
Zo.Naderi-Iran
|
|
|
|
|
This is a discussion board about Visual C++ and MFC. You should post this question on a delphi related board.
|
|
|
|
|
thank you.
but, which discussion board is delphi related board?
Zo.Naderi-Iran
|
|
|
|
|
There aren't any on this site.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
excuse me.
we don't need "to disable incremental linking" in Delphi project. becuase in delphi, function name is its address
Zo.Naderi-Iran
|
|
|
|
|
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello everyone,
I read the description of dwAllocationGranularity from,
1. http://msdn2.microsoft.com/en-us/library/ms724958.aspx
2. http://msdn2.microsoft.com/en-us/library/aa366887(VS.85).aspx
and tested on my system it is 65535.
But from the above description, I do not quite understand what does it mean. Does it mean that when memory manager deals with real memory allocation, it will always allocate 65535 bytes at a time, and divide into small chunks to upper level API (for example, when we new[256], it will allocate 256 bytes from the 65535 allocated raw bytes to application)?
Another question is, what benefit will we get if we know this parameter? For example, how do we allocate memory will utilize the system at most to achieve best performance?
thanks in advance,
George
|
|
|
|
|
George_George wrote: Does it mean that when memory manager deals with real memory allocation, it will always allocate 65535 bytes at a time
Yes.
George_George wrote: when we new[256], it will allocate 256 bytes from the 65535 allocated raw bytes to application
Yes, unless there isn't a big enough free block then it will allocate another 64K bytes.
George_George wrote: what benefit will we get if we know this parameter? For example, how do we allocate memory will utilize the system at most to achieve best performance?
All that it really tells you is that any such parameter is a compromise. Different applications would benefit from different values but the system can only have one default. A database app might benefit from large allocation chunks while a performance monitoring app might want smaller chunks.
There's not much you can do about this short of writing your own more sophisticated memory manager which is what you get in the .NET Runtime. I've written a prototype 'bucket' based manager which uses a virtual stack to compromise between the garbage collection cost of .NET and the heap fragmentation cost of the OS. It's not anywhere near publishable form at the moment but one day I hope it will be. There are 3rd party memory managers already out there, Google for Leap Heap for example if you're interested.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
|
tell me how can show wave form in audio files.
modified on Tuesday, January 15, 2008 3:16:34 AM
|
|
|
|
|
What ?? What do you mean by drawing ?? A audio file is just a file that contains binary data, you cannot "draw" something in it.
Could you elaborate please ?
|
|
|
|
|
i mean how can i show waveform in audio files.
|
|
|
|
|
Well, you don't give a lot of explanation, do you ?
I suppose that you want to extract the data which is in an audio file and display it on the screen, is that correct ?
Where are you stuck exactly, what did you already tried, which kind of audio files are you talking about ?
|
|
|
|
|
how can i tell u that,
i m sending u a link just chk it n the image on this link.
http://www.codeproject.com/KB/audio-video/waveeditBydswigger.aspx
i want this type of wave form in my audio file like MP3.
thanks n regards.
|
|
|
|
|
This is going to seem a bit complex...
You link to an article that has a picture of a program drawing the contents of an audio file to a window (ie, HDC).
The article has a download source link.
Have you tried reading the source to find out how it was done for that program?
Iain.
|
|
|
|