|
How to find the Machine IP Address.A function which finds the Maching IP address.
|
|
|
|
|
I presume the input is machine name. If so, we can find the ip address using the following Win32 API's.
GetMacAddress(strMachineName, F1, F2, F3, F4)
where F1..F4 are of type BYTE and strMachineName is a char*.
The result 'true' indicate, successfully executed the command.
|
|
|
|
|
WSA Error 10044 comes out
when run in windows 95
may i know what is the cause and how to solve it
thanks
|
|
|
|
|
Anonymous wrote:
WSA Error 10044
Error code means that you tried to use an unsupported function. This will most probably be due not having Windows Sockets version 2.0 (or greater)installed. Go to the microsoft web site and download the latest version of Wsock32.dll. This should fix the problem.
|
|
|
|
|
I am looking for a simple project, in VC,
the project shall allow the user to build a TCP/UDP packet via a GUI and then with the simple press of the button the packet shall be on the way
ideally the user will be sinding a ICMP packet and the user can fill the fields of the packet as he wishes
supershah
|
|
|
|
|
I have written an app that works ok on most networks , but one is prooving to be particularly unreliable. Given that I can do nothing about the network I am trying to beef up my code . On a simple CRecordset Open I have a try and all the catches I can think of .It uses a simple select statement. To test the code I run the app , disconnect the network prior to the open and see what happens. And what happens is not reliable . Sometimes my CDatabase exception handler is called , sometimes an SQL timeout message box appears. Click the box and it all recovers ok when the network is reconnected. This application is to work with no user intervention , and must be very reliable. Any ideas ?
I have tried debug /release versions with no optimisations , I have tried single and multithreaded versions , I have tried TCP/IP and multiprotocol with the latest MS SQL Server 7 driver .
|
|
|
|
|
When the winping utility is open for piniging two servers.. the result displayed is jumbled.. how do i trap the correct reponse?
Can i ping two servers from the same program?
Thanx
Borj
|
|
|
|
|
I'm afraid the ping utility deals with only one server.
|
|
|
|
|
OH NO IM VERY VERY AFRIA, ONLY ONE SERVER NOOOOO BOOOOO HOOOOOOOOOO IM SO UPSET NOW
Onkar Singh
|
|
|
|
|
The ping times are inaccurate in Windows 2000 because of the resolution of GetTickCount. You can use timeBeginPeriod(1), timeGetTime() and timeEndPeriod(1) to get it to work at a resolution of 1ms.
|
|
|
|
|
When i try to ping with dynamic data size i found that it is impossible to ping more than 55 bytes :
1 . First i change :
char cData[REQ_DATASIZE] To pointer char *cData;
2. Next i change SendEchoRequest :
echoReq.cData = new char[m_Param.nPacket_size] ;
3. Last i change sendto size parameter :
int nSize = sizeof(ECHOREQUEST)+m_Param.nPacket_size ;
- Now, if i ping with any size below 55 bytes all work just fine. But if i want to send more data i get all the time "timeout" in WaitForEchoRequest .
Someone have an idea ?
|
|
|
|
|
I passed on the IP address instaedof the hostname and the application seems to work although it should not (cos you are using gethostbyname() .... however on another PC -(Server) it failed and said that it knows nothing about the host......(ie gethostbyname failes ) and that shoudl not be suprising when you are passing the hostip instaed of the name....
How can i modify this to take the IP address instead of the hostname?
|
|
|
|
|
try this
SOCKADDR_IN saServer;
memset(&saServer,0x00,sizeof(saServer));
saServer.sin_family = AF_INET;
saServer.sin_addr.s_addr = inet_addr(m_szServer);
saServer.sin_port = htons(m_nPort);
// Establish a connection to the server socket.
if (connect (m_hSocket,
(PSOCKADDR) &saServer,
sizeof (saServer)) == SOCKET_ERROR)
{
closesocket (m_hSocket);
m_hSocket = NULL;
DWORD err = GetLastError();
return FALSE;
}
|
|
|
|
|
You did very well to update the article this coming september. Your article states the last update as '16 Sep 2001', which unless i'm very behind with my dates, is in about 8 months time .
|
|
|
|
|
Yep! code ahead of its time
|
|
|
|
|
Absolutely love WinPing, use it heaps. It would be much faster to use if the focus returned to the edit control after the ping operation completed. Thanks
|
|
|
|
|
You are missing the res/ directory in the source download and it will not build
|
|
|
|
|
The next new version fixes problems list below this comment
|
|
|
|
|
Your app does not accurately ping. In fact the CPing class measures a Sleep(1000) function if you get a valid ping. Either modify your WaitForEchoReply or your Ping method and you can get it to work pretty well. The other thing is the repeated entries in the combo box (you need to check for repeats).
It is a nice start but needs some work
|
|
|
|
|
This is now fixed GuyJeff
|
|
|
|
|
Keep getting this error message when using WinPing to ping a host.
socket() -WSAError: 10013
appreciate the answer.
thanks
|
|
|
|
|
A Socket or WSASocket call that specifies the SOCK_RAW socket type fails with Winsock error 10013 WSAEACCES if the user is a non-administrator logged onto a Windows NT 4.0 or Windows 2000 system.
This is by design.
|
|
|
|
|
eheh... You don't have user privileges!
Zot!
|
|
|
|
|
It would be most useful if one could ping
a remote machine from a normal user account.
How does the System32\ping.exe manage this?
|
|
|
|
|
In debugbuild I get at the end of the ping an assert, because the hwnd of m_cboServers is zero.
That's because you didn't bind the m_cboServers control with the DialogCtrl-ID IDC_SERVERS.
Only insert DDX_Control(pDX, IDC_SERVERS, m_cboServers);
in the WinPingDlg and it work allright.
Mike Wil
|
|
|
|